Skip to content

Commit

Permalink
Move loop after complex tests definition
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd committed Mar 14, 2017
1 parent dcbb44d commit bb11eaf
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/Constraints/CoerciveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,6 @@ public function dataCoerceCases()
),
);

$tests = array();
foreach ($types as $toType => $testCases) {
foreach ($testCases as $testCase) {
$tests[] = array(
sprintf('{"properties":{"propertyOne":{"type":"%s"}}}', strtolower($toType)),
sprintf('{"propertyOne":%s}', $testCase[1]),
$testCase[0],
$toType,
$testCase[2],
$testCase[3]
);
}
}

// #38 check post-coercion validation (to array)
$tests[] = array(
'{"properties":{"propertyOne":{"type":"array","items":[{"type":"number"}]}}}',
Expand Down Expand Up @@ -150,6 +136,20 @@ public function dataCoerceCases()
'string', 'integer', 42, true
);

$tests = array();
foreach ($types as $toType => $testCases) {
foreach ($testCases as $testCase) {
$tests[] = array(
sprintf('{"properties":{"propertyOne":{"type":"%s"}}}', strtolower($toType)),
sprintf('{"propertyOne":%s}', $testCase[1]),
$testCase[0],
$toType,
$testCase[2],
$testCase[3]
);
}
}

return $tests;
}

Expand Down

0 comments on commit bb11eaf

Please sign in to comment.