-
-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitting tests for better readability and debugging
- Loading branch information
Showing
26 changed files
with
1,649 additions
and
1,444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony MakerBundle package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\MakerBundle\Test; | ||
|
||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; | ||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | ||
use Symfony\Bundle\MakerBundle\DependencyInjection\CompilerPass\MakeCommandRegistrationPass; | ||
use Symfony\Bundle\MakerBundle\MakerBundle; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; | ||
use Symfony\Component\Routing\RouteCollectionBuilder; | ||
|
||
class MakerTestKernel extends Kernel implements CompilerPassInterface | ||
{ | ||
use MicroKernelTrait; | ||
|
||
private $testRootDir; | ||
|
||
public function __construct(string $environment, bool $debug) | ||
{ | ||
$this->testRootDir = sys_get_temp_dir().'/'.uniqid('sf_maker_', true); | ||
|
||
parent::__construct($environment, $debug); | ||
} | ||
|
||
public function registerBundles() | ||
{ | ||
return [ | ||
new FrameworkBundle(), | ||
new MakerBundle(), | ||
]; | ||
} | ||
|
||
protected function configureRoutes(RouteCollectionBuilder $routes) | ||
{ | ||
} | ||
|
||
protected function configureRouting(RoutingConfigurator $routes) | ||
{ | ||
} | ||
|
||
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader) | ||
{ | ||
$c->setParameter('kernel.secret', 123); | ||
} | ||
|
||
public function getProjectDir() | ||
{ | ||
return $this->getRootDir(); | ||
} | ||
|
||
public function getRootDir() | ||
{ | ||
return $this->testRootDir; | ||
} | ||
|
||
public function process(ContainerBuilder $container) | ||
{ | ||
// makes all makers public to help the tests | ||
foreach ($container->findTaggedServiceIds(MakeCommandRegistrationPass::MAKER_TAG) as $id => $tags) { | ||
$defn = $container->getDefinition($id); | ||
$defn->setPublic(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.