Skip to content

Commit

Permalink
Improve tests compatibility (#193)
Browse files Browse the repository at this point in the history
Some tests were not working out of the box on my environment (Mac M1,
docker). These changes fix two of the failing tests.

Co-authored-by: vasily.pyatykh <[email protected]>
  • Loading branch information
ivastly and ivastly authored Sep 20, 2023
1 parent df3ab9f commit f03a720
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/LicenseCheckerCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function test_failure_with_path_that_is_not_composer_project_root(): void
$handle = $this->createTempFile();
$allowFile = LicenseConfigurationFileBuilder::create($handle)->build();

$this->commandTester->execute(['--allow-file' => $allowFile, '--path' => '../']);
$this->commandTester->execute(['--allow-file' => $allowFile, '--path' => __DIR__]);

CommandTesterAsserter::assertThat($this->commandTester)
->hasStatusCode(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function test_throws_if_installed_json_missing(): void

$this->expectExceptionObject(
FailedProvidingPackages::withReason(
\sprintf('File "%s" not found', $this->projectPath.'/vendor/composer/installed.json'),
\sprintf('File "%s" not found', \realpath($this->projectPath).'/vendor/composer/installed.json'),
),
);

Expand All @@ -152,7 +152,7 @@ public function test_throws_if_installed_json_not_readable(): void

$this->expectExceptionObject(
FailedProvidingPackages::withReason(
\sprintf('File "%s" is not readable', $this->projectPath.'/vendor/composer/installed.json'),
\sprintf('File "%s" is not readable', \realpath($this->projectPath.'/vendor/composer/installed.json')),
),
);

Expand Down

0 comments on commit f03a720

Please sign in to comment.