Completed
Push — master ( 0fd1e7...aad679 )
by Jérémy
02:00
created

OpenGraphExtension::testRenderTagFunction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 15
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 15
loc 15
rs 9.4285
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
3
namespace Novaway\Bundle\OpenGraphBundle\Tests\Units\Twig;
4
5
use atoum;
6
7
class OpenGraphExtension extends atoum
8
{
9
    public function testRenderNamespaceAttributesFunction()
10
    {
11
        $this
12
            ->given(
13
                $renderer = new \mock\Novaway\Component\OpenGraph\View\OpenGraphRendererInterface(),
14
                $graph = new \mock\Novaway\Component\OpenGraph\OpenGraphInterface()
15
            )
16
            ->if($this->newTestedInstance($renderer))
17
            ->then
18
                ->given($this->testedInstance->renderNamespaceFunction($graph))
19
                ->mock($renderer)
20
                    ->call('renderNamespaceAttributes')
21
                        ->withAtLeastArguments([$graph])->once()
22
        ;
23
    }
24
25
    public function testRenderGraphFunction()
26
    {
27
        $this
28
            ->given(
29
                $renderer = new \mock\Novaway\Component\OpenGraph\View\OpenGraphRendererInterface(),
30
                $graph = new \mock\Novaway\Component\OpenGraph\OpenGraphInterface()
31
            )
32
            ->if($this->newTestedInstance($renderer))
33
            ->then
34
                ->given($this->testedInstance->renderGraphFunction($graph))
35
                    ->mock($renderer)
36
                        ->call('render')
37
                            ->withAtLeastArguments([$graph])->once()
38
        ;
39
    }
40
41
    public function testRenderTagFunction()
42
    {
43
        $this
44
            ->given(
45
                $renderer = new \mock\Novaway\Component\OpenGraph\View\OpenGraphRendererInterface(),
46
                $tag = new \mock\Novaway\Component\OpenGraph\OpenGraphTagInterface()
47
            )
48
            ->if($this->newTestedInstance($renderer))
49
            ->then
50
                ->given($this->testedInstance->renderTagFunction($tag))
51
                    ->mock($renderer)
52
                        ->call('renderTag')
53
                            ->withAtLeastArguments([$tag])->once()
54
        ;
55
    }
56
}
57
58