Passed
Pull Request — master (#5)
by
unknown
04:17
created

PriceNameResolverSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_resolves_min_price_name() 0 3 1
A it_is_initializable() 0 3 1
A it_resolves_max_price_name() 0 3 1
A let() 0 3 1
A it_implements_price_name_resolver_interface() 0 3 1
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace spec\BitBag\SyliusElasticsearchPlugin\PropertyNameResolver;
14
15
use BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\PriceNameResolver;
16
use BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\PriceNameResolverInterface;
17
use PhpSpec\ObjectBehavior;
18
19
final class PriceNameResolverSpec extends ObjectBehavior
20
{
21
    function let(): 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->beConstructedWith('price');
24
    }
25
26
    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...
27
    {
28
        $this->shouldHaveType(PriceNameResolver::class);
29
    }
30
31
    function it_implements_price_name_resolver_interface(): void
32
    {
33
        $this->shouldHaveType(PriceNameResolverInterface::class);
34
    }
35
36
    function it_resolves_min_price_name(): void
37
    {
38
        $this->resolveMinPriceName()->shouldBeEqualTo('min_price');
0 ignored issues
show
Bug introduced by
The method resolveMinPriceName() does not exist on spec\BitBag\SyliusElasti...r\PriceNameResolverSpec. 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

38
        $this->/** @scrutinizer ignore-call */ 
39
               resolveMinPriceName()->shouldBeEqualTo('min_price');
Loading history...
39
    }
40
41
    function it_resolves_max_price_name(): void
42
    {
43
        $this->resolveMaxPriceName()->shouldBeEqualTo('max_price');
0 ignored issues
show
Bug introduced by
The method resolveMaxPriceName() does not exist on spec\BitBag\SyliusElasti...r\PriceNameResolverSpec. 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

43
        $this->/** @scrutinizer ignore-call */ 
44
               resolveMaxPriceName()->shouldBeEqualTo('max_price');
Loading history...
44
    }
45
}
46