Skip to content

Commit d798605

Browse files
committed
fix array test
1 parent 48830a5 commit d798605

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

test/functional/arrayTests.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ describe('Array without keys', function() {
6565

6666
it('should have correct item types and values', function () {
6767
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');
6969

7070
ast[1][0][1][1].value[0].should.be.exactly("string");
7171
ast[1][0][1][1].value[1].should.be.exactly("item2");
7272

7373
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');
7575

7676
ast[1][0][1][3].value[0].should.be.exactly("string");
7777
ast[1][0][1][3].value[1].should.be.exactly("item4");
@@ -103,29 +103,29 @@ describe('Array without keys', function() {
103103
});
104104

105105
// 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()]');
109109

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+
});
113113

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+
});
117117

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");
121121

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");
124124

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+
});
129129

130130
describe('of arrays', function () {
131131
// Get result from parser

0 commit comments

Comments
 (0)