2
2
3
3
namespace UnitTest \PhpDocReader ;
4
4
5
- use Doctrine \Common \Annotations \Annotation \Target ;
6
5
use PhpDocReader \PhpDocReader ;
7
6
8
7
/**
@@ -18,7 +17,7 @@ public function testGetParameterTypeUseStatementBeforeLocalNamespace()
18
17
{
19
18
$ parser = new PhpDocReader ();
20
19
21
- $ target1 = new Fixtures \TargetFixture1 ();
20
+ $ target1 = new FixturesIssue87 \TargetFixture1 ();
22
21
23
22
$ target1ReflectionClass = new \ReflectionClass ($ target1 );
24
23
$ target1ReflectionMethod = $ target1ReflectionClass ->getMethod ("SomeMethod " );
@@ -27,17 +26,17 @@ public function testGetParameterTypeUseStatementBeforeLocalNamespace()
27
26
$ result = $ parser ->getParameterType ($ target1ReflectionParams [0 ]);
28
27
29
28
//Since TargetFixture1 file has a use statement to the Subspace namespace, that's the one that should be returned
30
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture ' , $ result );
29
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture ' , $ result );
31
30
32
31
33
32
$ result = $ parser ->getParameterType ($ target1ReflectionParams [1 ]);
34
33
35
34
//this parameter should be unaffected by use namespace since it has a relative type path
36
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
35
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
37
36
38
37
39
38
40
- $ target2 = new Fixtures \TargetFixture2 ();
39
+ $ target2 = new FixturesIssue87 \TargetFixture2 ();
41
40
42
41
$ target2ReflectionClass = new \ReflectionClass ($ target2 );
43
42
$ target2ReflectionMethod = $ target2ReflectionClass ->getMethod ("SomeMethod " );
@@ -46,17 +45,17 @@ public function testGetParameterTypeUseStatementBeforeLocalNamespace()
46
45
$ result = $ parser ->getParameterType ($ target2ReflectionParams [0 ]);
47
46
48
47
//Since TargetFixture2 file has a use statement with an alias to the Subspace namespace, that's the one that should be returned
49
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
48
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
50
49
51
50
52
51
$ result = $ parser ->getParameterType ($ target2ReflectionParams [1 ]);
53
52
54
53
//this parameter should be unaffected by use namespace since it has a relative type path
55
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
54
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
56
55
57
56
58
57
59
- $ target3 = new Fixtures \TargetFixture3 ();
58
+ $ target3 = new FixturesIssue87 \TargetFixture3 ();
60
59
61
60
$ target3ReflectionClass = new \ReflectionClass ($ target3 );
62
61
$ target3ReflectionMethod = $ target3ReflectionClass ->getMethod ("SomeMethod " );
@@ -65,13 +64,13 @@ public function testGetParameterTypeUseStatementBeforeLocalNamespace()
65
64
$ result = $ parser ->getParameterType ($ target3ReflectionParams [0 ]);
66
65
67
66
//Since TargetFixture3 file has NO use statement, the one local to the target's namespace should be used
68
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \SomeDependencyFixture ' , $ result );
67
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \SomeDependencyFixture ' , $ result );
69
68
70
69
71
70
$ result = $ parser ->getParameterType ($ target3ReflectionParams [1 ]);
72
71
73
72
//this parameter should be unaffected by use namespace since it has a relative type path
74
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
73
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
75
74
}
76
75
77
76
@@ -83,62 +82,62 @@ public function testGetPropertyTypeUseStatementBeforeLocalNamespace()
83
82
{
84
83
$ parser = new PhpDocReader ();
85
84
86
- $ target1 = new Fixtures \TargetFixture1 ();
85
+ $ target1 = new FixturesIssue87 \TargetFixture1 ();
87
86
88
87
$ target1ReflectionClass = new \ReflectionClass ($ target1 );
89
88
$ target1ReflectionProperty1 = $ target1ReflectionClass ->getProperty ("dependency1 " );
90
89
91
90
$ result = $ parser ->getPropertyType ($ target1ReflectionProperty1 );
92
91
93
92
//Since TargetFixture1 file has a use statement to the Subspace namespace, that's the one that should be returned
94
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture ' , $ result );
93
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture ' , $ result );
95
94
96
95
97
96
$ target1ReflectionProperty2 = $ target1ReflectionClass ->getProperty ("dependency2 " );
98
97
99
98
$ result = $ parser ->getPropertyType ($ target1ReflectionProperty2 );
100
99
101
100
//this property should be unaffected by use namespace since it has a relative type path
102
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
101
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
103
102
104
103
105
104
106
- $ target2 = new Fixtures \TargetFixture2 ();
105
+ $ target2 = new FixturesIssue87 \TargetFixture2 ();
107
106
108
107
$ target2ReflectionClass = new \ReflectionClass ($ target2 );
109
108
$ target2ReflectionProperty1 = $ target2ReflectionClass ->getProperty ("dependency1 " );
110
109
111
110
$ result = $ parser ->getPropertyType ($ target2ReflectionProperty1 );
112
111
113
112
//Since TargetFixture2 file has a use statement with an alias to the Subspace namespace, that's the one that should be returned
114
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
113
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
115
114
116
115
117
116
$ target2ReflectionProperty2 = $ target2ReflectionClass ->getProperty ("dependency2 " );
118
117
119
118
$ result = $ parser ->getPropertyType ($ target2ReflectionProperty2 );
120
119
121
120
//this property should be unaffected by use namespace since it has a relative type path
122
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
121
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
123
122
124
123
125
124
126
- $ target3 = new Fixtures \TargetFixture3 ();
125
+ $ target3 = new FixturesIssue87 \TargetFixture3 ();
127
126
128
127
$ target3ReflectionClass = new \ReflectionClass ($ target3 );
129
128
$ target3ReflectionProperty1 = $ target3ReflectionClass ->getProperty ("dependency1 " );
130
129
131
130
$ result = $ parser ->getPropertyType ($ target3ReflectionProperty1 );
132
131
133
132
//Since TargetFixture3 file has NO use statement, the one local to the target's namespace should be used
134
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \SomeDependencyFixture ' , $ result );
133
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \SomeDependencyFixture ' , $ result );
135
134
136
135
137
136
$ target3ReflectionProperty2 = $ target3ReflectionClass ->getProperty ("dependency2 " );
138
137
139
138
$ result = $ parser ->getPropertyType ($ target3ReflectionProperty2 );
140
139
141
140
//this property should be unaffected by use namespace since it has a relative type path
142
- $ this ->assertEquals ('UnitTest\PhpDocReader\Fixtures \Subspace\SomeDependencyFixture2 ' , $ result );
141
+ $ this ->assertEquals ('UnitTest\PhpDocReader\FixturesIssue87 \Subspace\SomeDependencyFixture2 ' , $ result );
143
142
}
144
143
}
0 commit comments