VueDirectiveTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
eloc 17
c 3
b 0
f 1
dl 0
loc 51
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A basicStartDirectiveReturnsCorrectPhpBlock() 0 7 1
A inlineEndDirectiveReturnsCorrectPhpBlock() 0 7 1
A inlineStartDirectiveReturnsCorrectPhpBlock() 0 7 1
A basicEndDirectiveReturnsCorrectPhpBlock() 0 7 1
1
<?php
2
3
namespace Jhoff\BladeVue\Testing\Unit;
4
5
use Jhoff\BladeVue\Element;
6
use Jhoff\BladeVue\Directives\Basic;
7
use Jhoff\BladeVue\Testing\TestCase;
8
use Jhoff\BladeVue\Directives\Inline;
9
10
class VueDirectiveTest extends TestCase
11
{
12
    /**
13
     * @test
14
     */
15
    public function basicStartDirectiveReturnsCorrectPhpBlock()
16
    {
17
        $code = Basic::start('"component", ["foo" => "bar"]');
18
19
        $this->assertEquals(
20
            '<?php echo \Jhoff\BladeVue\Components\Basic::start("component", ["foo" => "bar"]); ?><div>',
21
            $code
22
        );
23
    }
24
25
    /**
26
     * @test
27
     */
28
    public function basicEndDirectiveReturnsCorrectPhpBlock()
29
    {
30
        $code = Basic::end();
31
32
        $this->assertEquals(
33
            '</div><?php echo \Jhoff\BladeVue\Components\Basic::end(); ?>',
34
            $code
35
        );
36
    }
37
38
    /**
39
     * @test
40
     */
41
    public function inlineStartDirectiveReturnsCorrectPhpBlock()
42
    {
43
        $code = Inline::start('"component", ["foo" => "bar"]');
44
45
        $this->assertEquals(
46
            '<?php echo \Jhoff\BladeVue\Components\Inline::start("component", ["foo" => "bar"]); ?><div>',
47
            $code
48
        );
49
    }
50
51
    /**
52
     * @test
53
     */
54
    public function inlineEndDirectiveReturnsCorrectPhpBlock()
55
    {
56
        $code = Inline::end();
57
58
        $this->assertEquals(
59
            '</div><?php echo \Jhoff\BladeVue\Components\Inline::end(); ?>',
60
            $code
61
        );
62
    }
63
}
64