Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: enable symfony/runtime #48

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"psalm/plugin-phpunit": "^0.18.4",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/runtime": "^6.4 || ^7.0",
"symfony/uid": "^6.4 || ^7.0",
"symfony/var-dumper": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0",
Expand All @@ -73,6 +74,9 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"symfony/runtime": true
}
}
}
9 changes: 6 additions & 3 deletions tests/Common/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ class TestKernel extends Kernel
/**
* @param array<string,mixed> $config
*/
public function __construct(private array $config = [])
{
parent::__construct('test', true);
public function __construct(
private array $config = [],
string $env = 'test',
bool $debug = true
) {
parent::__construct($env, $debug);
}

public function registerBundles(): iterable
Expand Down
13 changes: 9 additions & 4 deletions tests/console
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ namespace Rekalogika\Mapper\Tests;
use Rekalogika\Mapper\Tests\Common\TestKernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

require_once __DIR__ . '/../vendor/autoload.php';
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

$kernel = new TestKernel();
$application = new Application($kernel);
$application->run();
return function (array $context) {
$env = $context['APP_ENV'] ?? 'test';
assert(is_string($env));

$kernel = new TestKernel([], $env, (bool) $context['APP_DEBUG']);

return new Application($kernel);
};
Loading