Skip to content

Commit d83a6fd

Browse files
committed
Added test cases
1 parent 12aacec commit d83a6fd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/Coduo/PHPMatcher/Matcher/ArrayMatcherTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public static function negativeMatchData()
134134

135135
return array(
136136
array($simpleArr, $simpleDiff),
137+
array(array("status" => "ok", "data" => array(array('foo'))), array("status" => "ok", "data" => array())),
137138
array(array(1), array()),
138139
array(array('key' => 'val'), array('key' => 'val2')),
139140
array(array(1), array(2)),

tests/Coduo/PHPMatcher/Matcher/JsonMatcherTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ public static function negativeMatches()
129129
'{this_is_not_valid_json',
130130
'{"users":["Michał","@string@"]}'
131131
),
132+
array(
133+
'{"status":"ok","data":[]}',
134+
'{"status":"ok","data":[{"id": 4,"code":"123987","name":"Anvill","short_description":"ACME Anvill","url":"http://test-store.example.com/p/123987","image":{"url":"http://test-store.example.com/i/123987-0.jpg","description":"ACME Anvill"},"price":95,"promotion_description":"Anvills sale"},{"id": 5,"code":"123988","name":"Red Anvill","short_description":"Red ACME Anvill","url":"http://test-store.example.com/p/123988","image":{"url":"http://test-store.example.com/i/123988-0.jpg","description":"ACME Anvill"},"price":44.99,"promotion_description":"Red is cheap"}]}'
135+
),
136+
array(
137+
'{"foo":"foo val","bar":"bar val"}',
138+
'{"foo":"foo val"}'
139+
),
132140
array(
133141
array(),
134142
'[]'

0 commit comments

Comments
 (0)