|
4 | 4 |
|
5 | 5 | use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
|
6 | 6 | use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle;
|
| 7 | +use FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle; |
7 | 8 | use Symfony\Bundle\MakerBundle\Maker\AbstractMaker;
|
8 | 9 | use Symfony\Component\Config\FileLocator;
|
9 | 10 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
10 | 11 | use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
| 12 | +use Symfony\Component\DependencyInjection\Reference; |
11 | 13 | use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;
|
12 | 14 | use Zenstruck\Foundry\Bundle\Command\StubMakeFactory;
|
13 | 15 | use Zenstruck\Foundry\Bundle\Command\StubMakeStory;
|
14 | 16 | use Zenstruck\Foundry\ModelFactory;
|
15 | 17 | use Zenstruck\Foundry\Story;
|
| 18 | +use Zenstruck\Foundry\Test\Behat\FactoriesContext; |
16 | 19 | use Zenstruck\Foundry\Test\ORMDatabaseResetter;
|
17 | 20 |
|
18 | 21 | /**
|
@@ -49,6 +52,13 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
|
49 | 52 | $container->register('.zenstruck_foundry.maker.factory_stub', StubMakeFactory::class)->addTag('console.command');
|
50 | 53 | $container->register('.zenstruck_foundry.maker.story_stub', StubMakeStory::class)->addTag('console.command');
|
51 | 54 | }
|
| 55 | + |
| 56 | + if (self::isBundleLoaded($container, FriendsOfBehatSymfonyExtensionBundle::class)) { |
| 57 | + $container->register('.zenstruck_foundry.behat.factories_context', FactoriesContext::class) |
| 58 | + ->addArgument(new Reference('service_container')) |
| 59 | + ->addTag('fob.context') |
| 60 | + ; |
| 61 | + } |
52 | 62 | }
|
53 | 63 |
|
54 | 64 | private function configureFaker(array $config, ContainerBuilder $container): void
|
|
0 commit comments