Skip to content

Commit

Permalink
Fix PHPUnit tests not running in CI and failing test (#37)
Browse files Browse the repository at this point in the history
* Fix expected exception message in test
* Align the regex of similar expected exception message in test
* Fix PHPUnit not running in CI
  • Loading branch information
meszarosrob authored Nov 3, 2023
1 parent c737aef commit c3886c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
dependency-versions: ${{ matrix.dependency-versions }}

- name: Run unit tests
run:
run: |
./vendor/bin/phpunit --atleast-version 9 && ./vendor/bin/phpunit --migrate-configuration || echo 'Config does not need updates.'
./vendor/bin/phpunit ${{ ((env.USE_COVERAGE == 'yes') && '--coverage-clover coverage.xml') || '--no-coverage' }}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function testAddModuleFailsAfterBuild(): void
{
$package = Package::new($this->mockProperties('test', true))->build();

$this->expectExceptionMessageMatches("/add module.+?status.+?at end of building stage/i");
$this->expectExceptionMessageMatches("/can't add module/i");

$package->addModule($this->mockModule());
}
Expand Down Expand Up @@ -850,7 +850,7 @@ public function testBootFailsIfPassingNotAddedModulesAfterContainer(): void
static::assertSame('service_1', $container->get('service_1')['id']);
static::assertSame('service_2', $container->get('service_2')['id']);

$this->expectExceptionMessageMatches('/add module module_3/i');
$this->expectExceptionMessageMatches("/can't add module module_3/i");
$this->ignoreDeprecations();
$package->boot($module2, $module3);
}
Expand Down

0 comments on commit c3886c3

Please sign in to comment.