Skip to content

Commit

Permalink
Readd mocker container
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Jun 10, 2024
1 parent 3207c28 commit aec5a96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"phpspec/phpspec": "^7.3",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.6.17",
"polishsymfonycommunity/symfony-mocker-container": "^1.0.7",
"psalm/plugin-phpunit": "^0.18.4",
"psalm/plugin-symfony": "^5.0",
"setono/budbee-bundle": "^1.0",
Expand Down
10 changes: 10 additions & 0 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;

final class Kernel extends BaseKernel
{
Expand Down Expand Up @@ -43,6 +44,15 @@ protected function configureRoutes(RoutingConfigurator $routes): void
}
}

protected function getContainerBaseClass(): string
{
if (str_contains($this->environment, 'test')) {
return MockerContainer::class;
}

return parent::getContainerBaseClass();
}

private function loadRoutesConfiguration(RoutingConfigurator $routes, string $confDir): void
{
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS);
Expand Down

0 comments on commit aec5a96

Please sign in to comment.