Open blacksheep122 opened 2 years ago
Same error. Are there any fixes?
Fastest way to fix it (for my case at least):
In composer.json:
"autoload-dev": {
"exclude-from-classmap": [
"vendor/codeception/module-lumen/src/Codeception/Lib/Connector/Lumen/DummyKernel.php",
],
"files": [
"app/Custom/Codeception/Lib/Connector/Lumen/DummyKernel.php",
],
Content of "app/Custom/Codeception/Lib/Connector/Lumen/DummyKernel.php":
<?php
declare(strict_types=1);
namespace Codeception\Lib\Connector\Lumen;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* Dummy kernel to satisfy the parent constructor of the LumenConnector class.
*/
class DummyKernel implements HttpKernelInterface
{
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true): void
{
//
}
}
@blacksheep122 , thanks!
After the fixes everything works as expected.
Below are some explanations.
tests/Support/DummyKernel.php
(location in my case):
<?php
declare(strict_types=1);
namespace Codeception\Lib\Connector\Lumen;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* Dummy kernel to satisfy the parent constructor of the LumenConnector class.
*/
class DummyKernel implements HttpKernelInterface
{
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true): Response
{
//
}
}
and valid json struct in composer.json
:
"autoload-dev": {
"exclude-from-classmap": [
"vendor/codeception/module-lumen/src/Codeception/Lib/Connector/Lumen/DummyKernel.php"
],
"files": [
"tests/Support/DummyKernel.php"
]
},
And don't forget to run composer dump-autoload
What are you trying to achieve?
Run tests in general (using make).
What do you get instead?
Details
composer show
):