File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -91,4 +91,35 @@ describe("Test namespace statements", function() {
91
91
) ;
92
92
// @todo : make assertions
93
93
} ) ;
94
+
95
+ it . only ( "should read usegroup location correctly" , function ( ) {
96
+ const testCase = [
97
+ "namespace Test\\test\\test;" ,
98
+ "" ,
99
+ "use Some\\other\\test;" ,
100
+ "" ,
101
+ "/**" ,
102
+ " * @property \\Test\\test $test" ,
103
+ " */" ,
104
+ "class Foo extends Bar implements Baz, Buzz {" ,
105
+ " public $test;" ,
106
+ "" ,
107
+ " function test() {" ,
108
+ " return true;" ,
109
+ " }" ,
110
+ "" ,
111
+ " public function &passByReferenceTest() {" ,
112
+ " $a = 1;" ,
113
+ " return $a;" ,
114
+ " }" ,
115
+ "}"
116
+ ] . join ( "\n" ) ;
117
+ const ast = parser . parseEval ( testCase , { ast : { withPositions : true } } ) ;
118
+ const astWithDocs = parser . parseEval ( testCase , {
119
+ ast : { withPositions : true } ,
120
+ parser : { extractDoc : true }
121
+ } ) ;
122
+ ast . children [ 0 ] . children [ 0 ] . loc . end . line . should . be . exactly ( 3 ) ;
123
+ astWithDocs . children [ 0 ] . children [ 0 ] . loc . end . line . should . be . exactly ( 3 ) ;
124
+ } ) ;
94
125
} ) ;
You can’t perform that action at this time.
0 commit comments