PathDeducerSpec::it_should_deduce_path()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
3
namespace spec\Knp\RadBundle\View;
4
5
use PhpSpec\ObjectBehavior;
6
7
class PathDeducerSpec extends ObjectBehavior
8
{
9
    /**
10
     * @param  Symfony\Component\Templating\TemplateNameParserInterface $nameParser
11
     * @param  Symfony\Component\Templating\TemplateReferenceInterface  $tplRef
12
     * @param  Knp\RadBundle\Filesystem\PathExpander                    $pathExpander
13
     */
14
    function let($nameParser, $pathExpander, $tplRef)
0 ignored issues
show
Unused Code introduced by
The parameter $tplRef is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        $this->beConstructedWith(
17
            $nameParser,
18
            $pathExpander,
19
            array('new' => 'KnpRadBundle:Assistant/skeleton:_new.html.twig',),
20
            'KnpRadBundle:Assistant/skeleton:_viewBody.html.twig'
21
        );
22
    }
23
24
    function it_should_deduce_path($nameParser, $pathExpander, $tplRef)
0 ignored issues
show
Coding Style introduced by
Method name "PathDeducerSpec::it_should_deduce_path" is not in camel caps format
Loading history...
25
    {
26
        $nameParser->parse('App:Cheeses:eat.html.twig')->willReturn($tplRef);
27
        $tplRef->getPath()->willReturn('@App/Resources/views/Cheeses/eat.html.twig');
28
29
        $pathExpander->expand('@App/Resources/views/Cheeses/eat.html.twig')->willReturn('/expanded/path');
30
31
        $this->deducePath('App:Cheeses:eat.html.twig')->shouldReturn('/expanded/path');
32
    }
33
34
    function it_should_deduce_the_skeleton_for_registered_names($nameParser, $pathExpander, $tplRef)
0 ignored issues
show
Unused Code introduced by
The parameter $pathExpander is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
Method name "PathDeducerSpec::it_should_deduce_the_skeleton_for_registered_names" is not in camel caps format
Loading history...
35
    {
36
        $nameParser->parse('App:Cheeses:new.html.twig')->willReturn($tplRef);
37
        $tplRef->get('name')->willReturn('new');
38
39
        $this->deduceViewLogicalName('App:Cheeses:new.html.twig')->shouldReturn('KnpRadBundle:Assistant/skeleton:_new.html.twig');
40
    }
41
42
    function it_should_deduce_the_fallback_skeleton_name($nameParser, $pathExpander, $tplRef)
0 ignored issues
show
Unused Code introduced by
The parameter $pathExpander is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
Method name "PathDeducerSpec::it_should_deduce_the_fallback_skeleton_name" is not in camel caps format
Loading history...
43
    {
44
        $nameParser->parse('App:Cheeses:eat.html.twig')->willReturn($tplRef);
45
        $tplRef->get('name')->willReturn('eat');
46
47
        $this->deduceViewLogicalName('App:Cheeses:eat.html.twig')->shouldReturn('KnpRadBundle:Assistant/skeleton:_viewBody.html.twig');
48
    }
49
}
50