Completed
Pull Request — 2.x (#521)
by Maximilian
03:40 queued 01:44
created

Kernel::getKernelDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\DoctrinePHPCRAdminBundle\Tests\Fixtures\App;
13
14
use ReflectionClass;
15
use Symfony\Cmf\Component\Testing\HttpKernel\TestKernel;
16
use Symfony\Component\Config\Loader\LoaderInterface;
17
18
class Kernel extends TestKernel
19
{
20
    public function configure()
21
    {
22
        $this->registerConfiguredBundles();
23
        $this->requireBundleSet('default');
24
        $this->requireBundleSets(['phpcr_odm',]);
25
    }
26
27
    public function getKernelDir()
28
    {
29
        $refl = new ReflectionClass($this);
30
        $fname = $refl->getFileName();
31
        $kernelDir = dirname($fname);
32
        var_dump('KERNEL_DIR_CREATED:'.PHP_EOL.$kernelDir);
0 ignored issues
show
Security Debugging Code introduced by
var_dump('KERNEL_DIR_CRE... PHP_EOL . $kernelDir); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
33
        var_dump('KERNEL_DIR:'.PHP_EOL.getenv('KERNEL_CLASS'));
34
        var_dump('KERNEL_DIR:'.PHP_EOL.getenv('KERNEL_DIR'));
35
        return $kernelDir;
36
    }
37
38
    public function registerContainerConfiguration(LoaderInterface $loader)
39
    {
40
        $loader->load(__DIR__ . '/config/config.php');
41
        $loader->load(__DIR__ . '/config/admin-test.xml');
42
    }
43
}
44