Skip to content

Commit 8a41d74

Browse files
committed
Fix line ending issue in Windows - 5
1 parent f4628b0 commit 8a41d74

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/spec/PathTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,25 +225,28 @@ public function testPathParametersAreArrays()
225225
$output = dirname(__DIR__) . $dirSep . 'compiled.yml';
226226
shell_exec('php ' . dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . $output);
227227

228-
$expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml";
228+
$baseExpected = dirname(__DIR__)."{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}";
229+
$expected = $baseExpected.'compiled-symfony-7.yml';
229230
$version = static::symfonyYamlVersion();
230231
$majorVersion = explode('.', $version)[0];
231232

232233
if ($majorVersion == 6) {
233-
$expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml";
234+
$expected = $baseExpected."compiled-symfony-6.yml";
234235
if (version_compare(PHP_VERSION, '8.1', '>=') && version_compare($version, '6.0.0', '!=')) {
235-
$expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml";
236+
$expected = $baseExpected."compiled-symfony-7.yml";
236237
}
237238
} elseif ($majorVersion == 5) {
238-
$expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml";
239+
$expected = $baseExpected."compiled-symfony-6.yml";
239240
}
240241
if (stripos(PHP_OS, 'WIN') === 0) {
242+
241243
// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6-windows-lf.yml";
242244
;
243245
file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output)));
246+
file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected)));
244247
}
245248

246-
$this->assertFileEquals($output, dirname(__DIR__) . $expected);
249+
$this->assertFileEquals($output, $expected);
247250
unlink($output);
248251
}
249252

0 commit comments

Comments
 (0)