BundleGuesserSpec   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 29
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A its_getBundle_gets_a_bundle_instance_given_a_className() 0 10 1
A its_getBundle_gets_the_default_app_bundle() 0 10 1
1
<?php
2
3
namespace spec\Knp\RadBundle\AppBundle;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
use Symfony\Component\HttpKernel\KernelInterface;
8
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
9
use Knp\RadBundle\Reflection\ReflectionFactory;
10
11
class BundleGuesserSpec extends ObjectBehavior
12
{
13
    function let(KernelInterface $kernel, ReflectionFactory $reflectionFactory)
14
    {
15
        $this->beConstructedWith($kernel, $reflectionFactory, array('App', 'TestBundle'));
16
    }
17
18
    function its_getBundle_gets_a_bundle_instance_given_a_className(BundleInterface $bundle, $kernel, $reflectionFactory, \ReflectionClass $refl)
0 ignored issues
show
Coding Style introduced by
Method name "BundleGuesserSpec::its_getBundle_gets_a_bundle_instance_given_a_className" is not in camel caps format
Loading history...
19
    {
20
        $refl->getParentClass()->willReturn(null);
21
        $refl->getNamespaceName()->willReturn('Vendor\Bundle\TestBundle\Controller');
22
        $bundle->getName()->willReturn('TestBundle');
23
        $bundle->getNamespace()->willReturn('Vendor\Bundle\TestBundle');
24
        $kernel->getBundles()->willReturn(array($bundle));
25
        $reflectionFactory->createReflectionClass(Argument::any())->willReturn($refl);
26
        $this->getBundleForClass('Vendor\Bundle\TestBundle\Controller\TestController')->shouldReturn($bundle);
27
    }
28
29
    function its_getBundle_gets_the_default_app_bundle(BundleInterface $bundle, $kernel, $reflectionFactory, \ReflectionClass $refl)
0 ignored issues
show
Coding Style introduced by
Method name "BundleGuesserSpec::its_getBundle_gets_the_default_app_bundle" is not in camel caps format
Loading history...
30
    {
31
        $refl->getParentClass()->willReturn(null);
32
        $refl->getNamespaceName()->willReturn('App\Controller');
33
        $bundle->getName()->willReturn('App');
34
        $bundle->getNamespace()->willReturn('App');
35
        $kernel->getBundles()->willReturn(array($bundle));
36
        $reflectionFactory->createReflectionClass(Argument::any())->willReturn($refl);
37
        $this->getBundleForClass('App\Controller\TestController')->shouldReturn($bundle);
38
    }
39
}
40