|
11 | 11 | use Monolog\Handler\NullHandler; |
12 | 12 | use Symfony\Component\EventDispatcher\EventDispatcher; |
13 | 13 |
|
14 | | -describe('ContextResolver', function(){ |
15 | | - beforeEach(function(){ |
| 14 | +describe('ContextResolver', function() { |
| 15 | + beforeEach(function() { |
16 | 16 | $logger = new Logger('spec'); |
17 | 17 | $logger->pushHandler(new NullHandler); |
18 | 18 | $this->index = new Index; |
|
21 | 21 | $this->resolver = new ContextResolver($this->parser, $this->typeResolver, $logger); |
22 | 22 | $this->dummyLine = '$obj->getMethod()->'; |
23 | 23 | }); |
24 | | - describe('->getContext()', function(){ |
25 | | - it('throws exception on empty line', function(){ |
| 24 | + describe('->getContext()', function() { |
| 25 | + it('throws exception on empty line', function() { |
26 | 26 | expect([$this->resolver, 'getContext']) |
27 | 27 | ->with('', $this->index)->to->throw('Exception'); |
28 | 28 | }); |
29 | | - it('returns Context instance', function(){ |
| 29 | + it('returns Context instance', function() { |
30 | 30 | $result = $this->resolver->getContext($this->dummyLine); |
31 | 31 | expect($result)->to->be->an->instanceof(Context::class); |
32 | 32 | }); |
33 | | - describe('Namespace', function(){ |
34 | | - it('has type namespace after namespace symbol', function(){ |
| 33 | + describe('Namespace', function() { |
| 34 | + it('has type namespace after namespace symbol', function() { |
35 | 35 | $context = $this->resolver->getContext('namespace '); |
36 | 36 | expect($context->isNamespace())->to->be->true; |
37 | 37 | }); |
38 | | - it('has type namespace after namespace symbol with TString', function(){ |
| 38 | + it('has type namespace after namespace symbol with TString', function() { |
39 | 39 | $context = $this->resolver->getContext('namespace SomeName'); |
40 | 40 | expect($context->isNamespace())->to->be->true; |
41 | 41 | }); |
42 | | - it('has type namespace after namespace symbol with TString and separator', function(){ |
| 42 | + it('has type namespace after namespace symbol with TString and separator', function() { |
43 | 43 | $context = $this->resolver->getContext('namespace SomeName\AndOther\Name'); |
44 | 44 | expect($context->isNamespace())->to->be->true; |
45 | 45 | }); |
46 | | - it('hasn\'t type namespace after ;', function(){ |
| 46 | + it('hasn\'t type namespace after ;', function() { |
47 | 47 | $context = $this->resolver->getContext('namespace SomeName\AndOther\Name;'); |
48 | 48 | expect($context->isNamespace())->to->be->false; |
49 | 49 | }); |
50 | 50 | }); |
51 | | - describe('Use', function(){ |
52 | | - it('has type use after use symbol', function(){ |
| 51 | + describe('Use', function() { |
| 52 | + it('has type use after use symbol', function() { |
53 | 53 | $context = $this->resolver->getContext('use '); |
54 | 54 | expect($context->isUse())->to->be->true; |
55 | 55 | }); |
56 | | - it('has type use after use symbol with TString', function(){ |
| 56 | + it('has type use after use symbol with TString', function() { |
57 | 57 | $context = $this->resolver->getContext('use SomeName'); |
58 | 58 | expect($context->isUse())->to->be->true; |
59 | 59 | }); |
60 | | - it('has type use after use symbol with TString and separator', function(){ |
| 60 | + it('has type use after use symbol with TString and separator', function() { |
61 | 61 | $context = $this->resolver->getContext('use SomeName\AndOther\Name'); |
62 | 62 | expect($context->isUse())->to->be->true; |
63 | 63 | }); |
64 | | - it('hasn\'t type use after ;', function(){ |
| 64 | + it('hasn\'t type use after ;', function() { |
65 | 65 | $context = $this->resolver->getContext('use SomeName\AndOther\Name;'); |
66 | 66 | expect($context->isUse())->to->be->false; |
67 | 67 | }); |
68 | 68 | }); |
69 | | - describe('Object', function(){ |
70 | | - it('has type object after object operator', function(){ |
| 69 | + describe('Object', function() { |
| 70 | + it('has type object after object operator', function() { |
71 | 71 | $context = $this->resolver->getContext('$var->'); |
72 | 72 | expect($context->isObject())->to->be->true; |
73 | 73 | }); |
74 | | - it('has type object after object operator and $this', function(){ |
| 74 | + it('has type object after object operator and $this', function() { |
75 | 75 | $context = $this->resolver->getContext('$this->'); |
76 | 76 | expect($context->isObject())->to->be->true; |
77 | 77 | }); |
78 | | - it('has type object after object operator with complex prefix', function(){ |
| 78 | + it('has type object after object operator with complex prefix', function() { |
79 | 79 | $context = $this->resolver->getContext('$var->getMethod()->param->'); |
80 | 80 | expect($context->isObject())->to->be->true; |
81 | 81 | }); |
82 | | - it('has type object after object operator with TString', function(){ |
| 82 | + it('has type object after object operator with TString', function() { |
83 | 83 | $context = $this->resolver->getContext('$var->param'); |
84 | 84 | expect($context->isObject())->to->be->true; |
85 | 85 | }); |
86 | | - it('hasn\'t type object after object operator with TString and separator', function(){ |
| 86 | + it('hasn\'t type object after object operator with TString and separator', function() { |
87 | 87 | $context = $this->resolver->getContext('$var->param;'); |
88 | 88 | expect($context->isObject())->to->be->false; |
89 | 89 | }); |
90 | | - it('hasn\'t type object after object operator with (', function(){ |
| 90 | + it('hasn\'t type object after object operator with (', function() { |
91 | 91 | $context = $this->resolver->getContext('$var->param('); |
92 | 92 | expect($context->isObject())->to->be->false; |
93 | 93 | }); |
94 | | - it('hasn\'t type object after object operator with TString and space', function(){ |
| 94 | + it('hasn\'t type object after object operator with TString and space', function() { |
95 | 95 | /** @var Context $context */ |
96 | 96 | $context = $this->resolver->getContext('$var->param '); |
97 | 97 | expect($context->isObject())->to->be->false; |
98 | 98 | }); |
99 | 99 | }); |
100 | | - describe("Method call", function () { |
101 | | - it('has type method call after (', function () { |
| 100 | + describe("Method call", function() { |
| 101 | + it('has type method call after (', function() { |
102 | 102 | $context = $this->resolver->getContext('$var->method('); |
103 | 103 | expect($context->isMethodCall())->to->be->true; |
104 | 104 | }); |
|
0 commit comments