Test loading kernel based on classname

This commit is contained in:
Kamil Kokot
2019-01-10 22:43:54 +01:00
parent 25e24f3d3a
commit 3f7f9ccdbb
2 changed files with 117 additions and 12 deletions

View File

@@ -51,6 +51,25 @@ final class TestContext implements Context
self::$filesystem->remove(self::$workingDir);
}
/**
* @Given a standard Symfony autoloader configured
*/
public function standardSymfonyAutoloaderConfigured(): void
{
$this->thereIsFile('vendor/autoload.php', sprintf(<<<'CON'
<?php
declare(strict_types=1);
$loader = require '%s';
$loader->addPsr4('App\\', __DIR__ . '/../src/');
$loader->addPsr4('App\\Tests\\', __DIR__ . '/../tests/');
return $loader;
CON
, __DIR__ . '/../../../vendor/autoload.php'));
}
/**
* @Given a working Symfony application with SymfonyExtension configured
*/
@@ -65,18 +84,7 @@ default:
CON
);
$this->thereIsFile('vendor/autoload.php', sprintf(<<<'CON'
<?php
declare(strict_types=1);
$loader = require '%s';
$loader->addPsr4('App\\', __DIR__ . '/../src/');
$loader->addPsr4('App\\Tests\\', __DIR__ . '/../tests/');
return $loader;
CON
, __DIR__ . '/../../../vendor/autoload.php'));
$this->standardSymfonyAutoloaderConfigured();
$this->thereIsFile('src/Kernel.php', <<<'CON'
<?php