Passed
Push — master ( f0e85b...b3377b )
by Joachim
12:25
created

ProductVariantTraitSpec.php$0 ➔ let()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Loevgaard\SyliusBarcodePlugin\Model;
6
7
use DateTimeInterface;
8
use Loevgaard\SyliusBarcodePlugin\Model\BarcodeAwareInterface;
9
use Loevgaard\SyliusBarcodePlugin\Model\ProductVariantTrait;
10
use PhpSpec\ObjectBehavior;
11
12
class ProductVariantTraitSpec extends ObjectBehavior
13
{
14
    public function let(): void
15
    {
16
        $class = new class() implements BarcodeAwareInterface {
17
            use ProductVariantTrait;
18
        };
19
20
        $this->beAnInstanceOf(get_class($class));
21
    }
22
23
    public function it_implements_barcode_aware_interface(): void
24
    {
25
        $this->shouldImplement(BarcodeAwareInterface::class);
26
    }
27
28
    public function it_marks_barcode_as_checked(): void
29
    {
30
        $this->markBarcodeAsChecked(true);
0 ignored issues
show
Bug introduced by
The method markBarcodeAsChecked() does not exist on spec\Loevgaard\SyliusBar...ProductVariantTraitSpec. 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

30
        $this->/** @scrutinizer ignore-call */ 
31
               markBarcodeAsChecked(true);
Loading history...
31
        $this->isBarcodeChecked()->shouldReturn(true);
0 ignored issues
show
Bug introduced by
The method isBarcodeChecked() does not exist on spec\Loevgaard\SyliusBar...ProductVariantTraitSpec. 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

31
        $this->/** @scrutinizer ignore-call */ 
32
               isBarcodeChecked()->shouldReturn(true);
Loading history...
32
    }
33
34
    public function it_sets_marked_timestamp(): void
35
    {
36
        $this->markBarcodeAsChecked(true);
37
        $this->getBarcodeChecked()->shouldReturnAnInstanceOf(DateTimeInterface::class);
0 ignored issues
show
Bug introduced by
The method getBarcodeChecked() does not exist on spec\Loevgaard\SyliusBar...ProductVariantTraitSpec. 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

37
        $this->/** @scrutinizer ignore-call */ 
38
               getBarcodeChecked()->shouldReturnAnInstanceOf(DateTimeInterface::class);
Loading history...
38
    }
39
40
    public function it_marks_barcode_as_valid(): void
41
    {
42
        $this->markBarcodeAsChecked(true);
43
        $this->isBarcodeValid()->shouldReturn(true);
0 ignored issues
show
Bug introduced by
The method isBarcodeValid() does not exist on spec\Loevgaard\SyliusBar...ProductVariantTraitSpec. 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
               isBarcodeValid()->shouldReturn(true);
Loading history...
44
    }
45
}
46