-
Notifications
You must be signed in to change notification settings - Fork 1
/
RichCongressUnitBundle.php
47 lines (41 loc) · 1.52 KB
/
RichCongressUnitBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php declare(strict_types=1);
namespace RichCongress\Bundle\UnitBundle;
use RichCongress\Bundle\UnitBundle\DependencyInjection\Compiler\DataFixturesPass;
use RichCongress\Bundle\UnitBundle\DependencyInjection\Compiler\OverrideServicesPass;
use RichCongress\Bundle\UnitBundle\DependencyInjection\Compiler\PublicServicesPass;
use RichCongress\Bundle\UnitBundle\Utility\FixturesManager;
use RichCongress\Bundle\UnitBundle\Utility\OverrideServicesUtility;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class RichCongressUnitBundle
*
* @package RichCongress\Bundle\UnitBundle
* @author Nicolas Guilloux <[email protected]>
* @copyright 2014 - 2019 RichCongress (https://www.richcongress.com)
*/
class RichCongressUnitBundle extends Bundle
{
/**
* @param ContainerBuilder $container
*
* @return void
*/
public function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new DataFixturesPass());
$container->addCompilerPass(new PublicServicesPass());
$container->addCompilerPass(new OverrideServicesPass());
}
/**
* @return void
*/
public function boot(): void
{
parent::boot();
// Mock services for the main container before loading fixtures
OverrideServicesUtility::mockServices($this->container);
// Autowire everything for the FixturesManager before the first test
$this->container->get(FixturesManager::class);
}
}