Skip to content

Commit

Permalink
Merge pull request #48 from pact-foundation/use-eol-constant
Browse files Browse the repository at this point in the history
test: Use PHP_EOL constant
  • Loading branch information
tienvx authored Apr 25, 2024
2 parents dacee30 + c8b3565 commit 8e62ac9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/Integration/CommandTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ protected function getExecutableFilesFromLibrary(): array
{
return [
'vendor/test/library/files/php/hello-php' => 'Hello from php file!',
'vendor/test/library/files/ruby/hello-ruby' => 'Hello from ruby file!'.$this->eol(),
'vendor/test/library/files/mix/bin/hello-python' => 'Hello from python file!'.$this->eol(),
'vendor/test/library/files/ruby/hello-ruby' => 'Hello from ruby file!'.\PHP_EOL,
'vendor/test/library/files/mix/bin/hello-python' => 'Hello from python file!'.\PHP_EOL,
'vendor/bin/hello-php' => 'Hello from php file!',
'vendor/bin/hello-ruby' => 'Hello from ruby file!'.$this->eol(),
'vendor/bin/hello-python' => 'Hello from python file!'.$this->eol(),
'vendor/bin/hello-ruby' => 'Hello from ruby file!'.\PHP_EOL,
'vendor/bin/hello-python' => 'Hello from python file!'.\PHP_EOL,
];
}

Expand Down Expand Up @@ -403,9 +403,4 @@ protected static function getLibraryPath(): string
{
return realpath(self::getFixturesPath().'/library');
}

protected function eol(): string
{
return \PHP_OS_FAMILY === 'Windows' ? "\r\n" : "\n";
}
}

0 comments on commit 8e62ac9

Please sign in to comment.