Skip to content

Commit e90e447

Browse files
committed
test: skip test which require 64 bits operating system
1 parent 5c92ede commit e90e447

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

tests/Constraints/VeryBaseTestCase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,9 @@ private function readAndJsonDecodeFile(string $file): stdClass
7171

7272
return json_decode(file_get_contents($file), false);
7373
}
74+
75+
protected function is32Bit(): bool
76+
{
77+
return PHP_INT_SIZE === 4;
78+
}
7479
}

tests/Drafts/Draft4Test.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public function getValidTests(): \Generator
7474
'refRemote.json / base URI change - change folder / number is valid',
7575
];
7676

77+
if ($this->is32Bit()) {
78+
$skip[] = 'multipleOf.json / small multiple of large integer / any integer is a multiple of 1e-8'; // Test case contains a number which doesn't fit in 32 bits
79+
}
80+
7781
foreach (parent::getValidTests() as $name => $testcase) {
7882
if (in_array($name, $skip, true)) {
7983
continue;

tests/JsonSchemaTestSuiteTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,16 @@ private function shouldNotYieldTest(string $name): bool
142142
'[draft4/refRemote.json]: Location-independent identifier in remote ref: string is invalid is expected to be invalid', // Test case was added after v1.2.0, skip test for now.
143143
];
144144

145+
if ($this->is32Bit()) {
146+
$skip[] = '[draft4/multipleOf.json]: small multiple of large integer: any integer is a multiple of 1e-8 is expected to be valid'; // Test case contains a number which doesn't fit in 32 bits
147+
}
148+
145149
return in_array($name, $skip, true);
146150
}
147151

152+
private function is32Bit(): bool
153+
{
154+
return PHP_INT_SIZE === 4;
155+
}
156+
148157
}

0 commit comments

Comments
 (0)