1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Stinger Media Parser package. |
5
|
|
|
* |
6
|
|
|
* (c) Oliver Kotte <[email protected]> |
7
|
|
|
* (c) Florian Meyer <[email protected]> |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, please view the LICENSE |
10
|
|
|
* file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
namespace StingerSoft\MediaParsingBundle\Tests; |
13
|
|
|
|
14
|
|
|
use StingerSoft\MediaParsingBundle\DependencyInjection\StingerSoftMediaParsingExtension; |
15
|
|
|
use StingerSoft\MediaParsingBundle\StingerSoftMediaParsingBundle; |
16
|
|
|
use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; |
17
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
18
|
|
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; |
19
|
|
|
|
20
|
|
|
class TestCase extends \PHPUnit_Framework_TestCase { |
21
|
|
|
|
22
|
|
|
public function createContainer(){ |
23
|
|
|
$container = new ContainerBuilder(new ParameterBag(array( |
24
|
|
|
'kernel.debug' => false, |
25
|
|
|
'kernel.bundles' => array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\YamlBundle'), |
26
|
|
|
'kernel.cache_dir' => sys_get_temp_dir(), |
27
|
|
|
'kernel.environment' => 'test', |
28
|
|
|
'kernel.root_dir' => __DIR__ . '/../../../../', // src dir |
29
|
|
|
))); |
30
|
|
|
$extension = new StingerSoftMediaParsingExtension(); |
31
|
|
|
$container->registerExtension($extension); |
32
|
|
|
$extension->load(array(), $container); |
33
|
|
|
|
34
|
|
|
$bundle = new StingerSoftMediaParsingBundle(); |
35
|
|
|
$bundle->build($container); |
36
|
|
|
|
37
|
|
|
$container->getCompilerPassConfig()->setOptimizationPasses(array(new ResolveDefinitionTemplatesPass())); |
38
|
|
|
$container->getCompilerPassConfig()->setRemovingPasses(array()); |
39
|
|
|
$container->compile(); |
40
|
|
|
|
41
|
|
|
return $container; |
42
|
|
|
} |
43
|
|
|
} |
44
|
|
|
|