@@ -49,7 +49,7 @@ describe('Test variables', function() {
49
49
'foo::class;' ,
50
50
'$this->foo();' ,
51
51
'foo::$bar;' ,
52
- '$this->foo::bar'
52
+ '$this->foo::bar["baz"]::qux(); '
53
53
] . join ( '\n' ) , {
54
54
parser : {
55
55
// debug: true
@@ -105,14 +105,29 @@ describe('Test variables', function() {
105
105
expr . offset . kind . should . be . exactly ( 'variable' ) ;
106
106
expr . offset . name . should . be . exactly ( 'bar' ) ;
107
107
} ) ;
108
- it ( 'should be $this->foo::bar' , function ( ) {
108
+ it ( 'should be $this->foo::bar["baz"]::qux(); ' , function ( ) {
109
109
var expr = ast . children [ 6 ] ;
110
- expr . kind . should . be . exactly ( 'staticlookup' ) ;
111
- expr . what . kind . should . be . exactly ( 'propertylookup' ) ;
112
- expr . what . what . kind . should . be . exactly ( 'variable' ) ;
113
- expr . what . what . name . should . be . exactly ( 'this' ) ;
114
- expr . what . offset . name . should . be . exactly ( 'foo' ) ;
115
- expr . offset . name . should . be . exactly ( 'bar' ) ;
110
+
111
+ expr . kind . should . be . exactly ( "call" ) ;
112
+ expr . arguments . length . should . be . exactly ( 0 ) ;
113
+
114
+ expr . what . kind . should . be . exactly ( "staticlookup" ) ;
115
+ expr . what . offset . kind . should . be . exactly ( "constref" ) ;
116
+ expr . what . offset . name . should . be . exactly ( "qux" ) ;
117
+
118
+ expr . what . what . kind . should . be . exactly ( "offsetlookup" ) ;
119
+ expr . what . what . offset . kind . should . be . exactly ( "string" ) ;
120
+ expr . what . what . offset . value . should . be . exactly ( "baz" ) ;
121
+
122
+ expr . what . what . what . kind . should . be . exactly ( "staticlookup" ) ;
123
+ expr . what . what . what . offset . kind . should . be . exactly ( "constref" ) ;
124
+ expr . what . what . what . offset . name . should . be . exactly ( "bar" ) ;
125
+
126
+ expr . what . what . what . what . kind . should . be . exactly ( "propertylookup" ) ;
127
+ expr . what . what . what . what . what . kind . should . be . exactly ( "variable" ) ;
128
+ expr . what . what . what . what . what . name . should . be . exactly ( "this" ) ;
129
+ expr . what . what . what . what . offset . kind . should . be . exactly ( "constref" ) ;
130
+ expr . what . what . what . what . offset . name . should . be . exactly ( "foo" ) ;
116
131
} ) ;
117
132
} ) ;
118
133
0 commit comments