@@ -65,13 +65,13 @@ describe('Array without keys', function() {
65
65
66
66
it ( 'should have correct item types and values' , function ( ) {
67
67
ast [ 1 ] [ 0 ] [ 1 ] [ 0 ] . value [ 0 ] . should . be . exactly ( "number" ) ;
68
- ast [ 1 ] [ 0 ] [ 1 ] [ 0 ] . value [ 1 ] . should . be . exactly ( 1 ) ;
68
+ ast [ 1 ] [ 0 ] [ 1 ] [ 0 ] . value [ 1 ] . should . be . exactly ( '1' ) ;
69
69
70
70
ast [ 1 ] [ 0 ] [ 1 ] [ 1 ] . value [ 0 ] . should . be . exactly ( "string" ) ;
71
71
ast [ 1 ] [ 0 ] [ 1 ] [ 1 ] . value [ 1 ] . should . be . exactly ( "item2" ) ;
72
72
73
73
ast [ 1 ] [ 0 ] [ 1 ] [ 2 ] . value [ 0 ] . should . be . exactly ( "number" ) ;
74
- ast [ 1 ] [ 0 ] [ 1 ] [ 2 ] . value [ 1 ] . should . be . exactly ( 3 ) ;
74
+ ast [ 1 ] [ 0 ] [ 1 ] [ 2 ] . value [ 1 ] . should . be . exactly ( '3' ) ;
75
75
76
76
ast [ 1 ] [ 0 ] [ 1 ] [ 3 ] . value [ 0 ] . should . be . exactly ( "string" ) ;
77
77
ast [ 1 ] [ 0 ] [ 1 ] [ 3 ] . value [ 1 ] . should . be . exactly ( "item4" ) ;
@@ -103,29 +103,29 @@ describe('Array without keys', function() {
103
103
} ) ;
104
104
105
105
// TODO -- Check this is valid PHP + check AST output is correct
106
- // describe('of objects', function () {
107
- // // Get result from parser
108
- // var ast = parser.parseEval('array( new stdClass (), new stdClass(), new stdClass()) ');
106
+ describe ( 'of objects' , function ( ) {
107
+ // Get result from parser
108
+ var ast = parser . parseEval ( '[ new foo (), new stdClass(), new bar()] ' ) ;
109
109
110
- // it('should be of type array', function () {
111
- // ast[1][0][0].should.be.exactly("array");
112
- // });
110
+ it ( 'should be of type array' , function ( ) {
111
+ ast [ 1 ] [ 0 ] [ 0 ] . should . be . exactly ( "array" ) ;
112
+ } ) ;
113
113
114
- // it('should have correct number of items', function () {
115
- // ast[1][0][1].length.should.be.exactly(3);
116
- // });
114
+ it ( 'should have correct number of items' , function ( ) {
115
+ ast [ 1 ] [ 0 ] [ 1 ] . length . should . be . exactly ( 3 ) ;
116
+ } ) ;
117
117
118
- // it('should have correct item types and values', function () {
119
- // ast[1][0][1][0].value[0].should.be.exactly("object ");
120
- // ast[1][0][1][0].value[1].should.be.exactly("stdClass() ");
118
+ it ( 'should have correct item types and values' , function ( ) {
119
+ ast [ 1 ] [ 0 ] [ 1 ] [ 0 ] . value [ 0 ] . should . be . exactly ( "new " ) ;
120
+ ast [ 1 ] [ 0 ] [ 1 ] [ 0 ] . value [ 1 ] [ 0 ] . should . be . exactly ( "foo " ) ;
121
121
122
- // ast[1][0][1][1].value[0].should.be.exactly("object ");
123
- // ast[1][0][1][1].value[1].should.be.exactly("stdClass() ");
122
+ ast [ 1 ] [ 0 ] [ 1 ] [ 1 ] . value [ 0 ] . should . be . exactly ( "new " ) ;
123
+ ast [ 1 ] [ 0 ] [ 1 ] [ 1 ] . value [ 1 ] [ 0 ] . should . be . exactly ( "stdClass" ) ;
124
124
125
- // ast[1][0][1][2].value[0].should.be.exactly("object ");
126
- // ast[1][0][1][2].value[1].should.be.exactly("stdClass() ");
127
- // });
128
- // });
125
+ ast [ 1 ] [ 0 ] [ 1 ] [ 2 ] . value [ 0 ] . should . be . exactly ( "new " ) ;
126
+ ast [ 1 ] [ 0 ] [ 1 ] [ 2 ] . value [ 1 ] [ 0 ] . should . be . exactly ( "bar " ) ;
127
+ } ) ;
128
+ } ) ;
129
129
130
130
describe ( 'of arrays' , function ( ) {
131
131
// Get result from parser
0 commit comments