Skip to content

Commit 07ff7ad

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents e8fcb14 + de2a5c2 commit 07ff7ad

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[![Build Status](https://travis-ci.org/defrag/JsonMatcher.svg)](https://travis-ci.org/defrag/JsonMatcher)

src/JsonMatcher/Matcher/ArrayMatcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function match($value, $pattern)
2525
$accessorBuilder->enableExceptionOnInvalidIndex();
2626
$accessor = $accessorBuilder->getPropertyAccessor();
2727

28-
$this->paths = [];
28+
$this->paths = array();
2929
foreach ($value as $key => $element) {
3030
$path = sprintf("[%s]", $key);
3131

tests/JsonMatcher/ArrayMatcherTest.php

+25-20
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ class ArrayMatcherTest extends \PHPUnit_Framework_TestCase
1111

1212
public function setUp()
1313
{
14-
$this->simpleArray = [
15-
'users' => [
16-
[
14+
$this->simpleArray = array(
15+
'users' => array(
16+
array(
1717
'firstName' => 'Norbert',
1818
'lastName' => 'Orzechowicz'
19-
],
20-
[
19+
),
20+
array(
2121
'firstName' => 'Michał',
2222
'lastName' => 'Dąbrowski'
23-
]
24-
],
23+
)
24+
),
2525
true,
2626
false,
2727
1,
2828
6.66
29-
];
29+
);
3030
}
3131

3232
public function test_match_arrays()
@@ -36,21 +36,26 @@ public function test_match_arrays()
3636
$matcher = new ArrayMatcher($chain);
3737

3838
$this->assertTrue($matcher->match($this->simpleArray, $this->simpleArray));
39-
$this->assertTrue($matcher->match([], []));
40-
$this->assertFalse($matcher->match($this->simpleArray, []));
41-
$this->assertFalse($matcher->match(['foo', 1, 3], ['foo', 2, 3]));
42-
$this->assertFalse($matcher->match($this->simpleArray, [6, 6.66, false, false, [1, 2, 'foo'], ['foo' => 'bar2'], null]));
43-
$this->assertFalse($matcher->match($this->simpleArray, [
44-
'users' => [
45-
[
39+
$this->assertTrue($matcher->match(array(), array()));
40+
$this->assertFalse($matcher->match($this->simpleArray, array()));
41+
$this->assertFalse($matcher->match(array('foo', 1, 3), array('foo', 2, 3)));
42+
$this->assertFalse($matcher->match($this->simpleArray, array(6, 6.66, false, false, array(1, 2, 'foo'), array('foo' => 'bar2'), null)));
43+
$this->assertFalse($matcher->match($this->simpleArray, array(
44+
'users' => array(
45+
array(
4646
'firstName' => 'Pawel',
4747
'lastName' => 'Orzechowicz'
48-
],
49-
[
48+
),
49+
array(
5050
'firstName' => 'Michał',
5151
'lastName' => 'Dąbrowski'
52-
]
53-
]
54-
]));
52+
)
53+
),
54+
true,
55+
false,
56+
1,
57+
6.66
58+
)));
5559
}
60+
5661
}

0 commit comments

Comments
 (0)