Skip to content

Commit

Permalink
WIP fixing windows build, #90
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Dec 23, 2020
1 parent 3da25a3 commit f77a472
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/spec/ReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public function testResolveFile()
$file = __DIR__ . '/data/reference/base.yaml';
if (stripos(PHP_OS, 'WIN') === 0) {
$yaml = str_replace('##ABSOLUTEPATH##', 'file:///' . strtr(dirname($file), [' ' => '%20', '\\' => '/']), file_get_contents($file));
throw new \Exception($yaml);
} else {
$yaml = str_replace('##ABSOLUTEPATH##', 'file://' . dirname($file), file_get_contents($file));
}
Expand Down Expand Up @@ -441,6 +442,8 @@ public function testTransitiveReferenceOverTwoFiles()
description: 'return a cat'
YAML;
// remove line endings to make string equal on windows
$expected = preg_replace('~\R~', "\n", $expected);
if (PHP_VERSION_ID < 70200) {
// PHP <7.2 returns numeric properties in yaml maps as integer, since 7.2 these are string
// probably related to https://www.php.net/manual/de/migration72.incompatible.php#migration72.incompatible.object-array-casts
Expand Down Expand Up @@ -492,6 +495,8 @@ public function testResolveRelativePathInline()
description: 'A Cat'
YAML;
// remove line endings to make string equal on windows
$expected = preg_replace('~\R~', "\n", $expected);
if (PHP_VERSION_ID < 70200) {
// PHP <7.2 returns numeric properties in yaml maps as integer, since 7.2 these are string
// probably related to https://www.php.net/manual/de/migration72.incompatible.php#migration72.incompatible.object-array-casts
Expand Down Expand Up @@ -560,6 +565,8 @@ public function testResolveRelativePathAll()
description: 'A Cat'
YAML;
// remove line endings to make string equal on windows
$expected = preg_replace('~\R~', "\n", $expected);
if (PHP_VERSION_ID < 70200) {
// PHP <7.2 returns numeric properties in yaml maps as integer, since 7.2 these are string
// probably related to https://www.php.net/manual/de/migration72.incompatible.php#migration72.incompatible.object-array-casts
Expand Down

0 comments on commit f77a472

Please sign in to comment.