1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Stinger Soft Platform 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\PlatformBundle\Tests; |
13
|
|
|
|
14
|
|
|
use StingerSoft\PlatformBundle\DependencyInjection\StingerSoftPlatformExtension; |
15
|
|
|
use StingerSoft\PlatformBundle\StingerSoftPlatformBundle; |
16
|
|
|
use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; |
17
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
18
|
|
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* $LastChangedBy: $ |
22
|
|
|
* $LastChangedDate: $ |
23
|
|
|
* |
24
|
|
|
* Class TestCase |
25
|
|
|
*/ |
26
|
|
|
class TestCase extends \PHPUnit_Framework_TestCase { |
27
|
|
|
|
28
|
|
|
public function createContainer() { |
29
|
|
|
$container = new ContainerBuilder(new ParameterBag(array( |
30
|
|
|
'kernel.debug' => false, |
31
|
|
|
// 'kernel.bundles' => array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\YamlBundle'), |
|
|
|
|
32
|
|
|
'kernel.cache_dir' => sys_get_temp_dir(), |
33
|
|
|
'kernel.environment' => 'test', |
34
|
|
|
'kernel.root_dir' => __DIR__ . '/../../../../' |
35
|
|
|
) // src dir |
36
|
|
|
)); |
37
|
|
|
$extension = new StingerSoftPlatformExtension(); |
38
|
|
|
$container->registerExtension($extension); |
39
|
|
|
$extension->load(array(), $container); |
40
|
|
|
|
41
|
|
|
$bundle = new StingerSoftPlatformBundle(); |
42
|
|
|
$bundle->build($container); |
43
|
|
|
|
44
|
|
|
$container->getCompilerPassConfig()->setOptimizationPasses(array( |
45
|
|
|
new ResolveDefinitionTemplatesPass() |
46
|
|
|
)); |
47
|
|
|
$container->getCompilerPassConfig()->setRemovingPasses(array()); |
48
|
|
|
$container->compile(); |
49
|
|
|
|
50
|
|
|
return $container; |
51
|
|
|
} |
52
|
|
|
} |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.