Skip to content

Commit f77a472

Browse files
committed
WIP fixing windows build, #90
1 parent 3da25a3 commit f77a472

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/spec/ReferenceTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public function testResolveFile()
141141
$file = __DIR__ . '/data/reference/base.yaml';
142142
if (stripos(PHP_OS, 'WIN') === 0) {
143143
$yaml = str_replace('##ABSOLUTEPATH##', 'file:///' . strtr(dirname($file), [' ' => '%20', '\\' => '/']), file_get_contents($file));
144+
throw new \Exception($yaml);
144145
} else {
145146
$yaml = str_replace('##ABSOLUTEPATH##', 'file://' . dirname($file), file_get_contents($file));
146147
}
@@ -441,6 +442,8 @@ public function testTransitiveReferenceOverTwoFiles()
441442
description: 'return a cat'
442443
443444
YAML;
445+
// remove line endings to make string equal on windows
446+
$expected = preg_replace('~\R~', "\n", $expected);
444447
if (PHP_VERSION_ID < 70200) {
445448
// PHP <7.2 returns numeric properties in yaml maps as integer, since 7.2 these are string
446449
// probably related to https://www.php.net/manual/de/migration72.incompatible.php#migration72.incompatible.object-array-casts
@@ -492,6 +495,8 @@ public function testResolveRelativePathInline()
492495
description: 'A Cat'
493496
494497
YAML;
498+
// remove line endings to make string equal on windows
499+
$expected = preg_replace('~\R~', "\n", $expected);
495500
if (PHP_VERSION_ID < 70200) {
496501
// PHP <7.2 returns numeric properties in yaml maps as integer, since 7.2 these are string
497502
// probably related to https://www.php.net/manual/de/migration72.incompatible.php#migration72.incompatible.object-array-casts
@@ -560,6 +565,8 @@ public function testResolveRelativePathAll()
560565
description: 'A Cat'
561566
562567
YAML;
568+
// remove line endings to make string equal on windows
569+
$expected = preg_replace('~\R~', "\n", $expected);
563570
if (PHP_VERSION_ID < 70200) {
564571
// PHP <7.2 returns numeric properties in yaml maps as integer, since 7.2 these are string
565572
// probably related to https://www.php.net/manual/de/migration72.incompatible.php#migration72.incompatible.object-array-casts

0 commit comments

Comments
 (0)