ProductVariantsDepositExtensionSpec   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_returns_functions() 0 6 2
A it_extends_twig_extension() 0 3 1
A it_is_initializable() 0 3 1
A let() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Gewebe\SyliusProductDepositPlugin\Templating\Helper;
6
7
use Gewebe\SyliusProductDepositPlugin\Templating\Helper\ProductVariantsDepositExtension;
8
use Gewebe\SyliusProductDepositPlugin\Templating\Helper\ProductVariantsDepositHelper;
9
use PhpSpec\ObjectBehavior;
10
use Twig\Extension\AbstractExtension;
11
use Twig\TwigFunction;
12
13
final class ProductVariantsDepositExtensionSpec extends ObjectBehavior
14
{
15
    function let(
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
        ProductVariantsDepositHelper $productVariantsDepositHelper
17
    ): void {
18
        $this->beConstructedWith($productVariantsDepositHelper);
19
    }
20
21
    function it_is_initializable(): void
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
22
    {
23
        $this->shouldHaveType(ProductVariantsDepositExtension::class);
24
    }
25
26
    function it_extends_twig_extension(): void
27
    {
28
        $this->shouldHaveType(AbstractExtension::class);
29
    }
30
31
    function it_returns_functions(): void
32
    {
33
        $functions = $this->getFunctions();
0 ignored issues
show
Bug introduced by
The method getFunctions() does not exist on spec\Gewebe\SyliusProduc...ntsDepositExtensionSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        /** @scrutinizer ignore-call */ 
34
        $functions = $this->getFunctions();
Loading history...
34
        $functions->shouldHaveCount(3);
35
        foreach ($functions as $function) {
36
            $function->shouldHaveType(TwigFunction::class);
37
        }
38
    }
39
}
40