Completed
Push — scalar-types/taxonomy ( 4d330b )
by Kamil
23:21
created

it_implements_active_promotions_provider_interface()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace spec\Sylius\Component\Promotion\Provider;
15
16
use PhpSpec\ObjectBehavior;
17
use Sylius\Component\Promotion\Model\PromotionInterface;
18
use Sylius\Component\Promotion\Model\PromotionSubjectInterface;
19
use Sylius\Component\Promotion\Provider\PreQualifiedPromotionsProviderInterface;
20
use Sylius\Component\Promotion\Repository\PromotionRepositoryInterface;
21
22
/**
23
 * @author Mateusz Zalewski <[email protected]>
24
 */
25
final class ActivePromotionsProviderSpec extends ObjectBehavior
26
{
27
    function let(PromotionRepositoryInterface $promotionRepository): void
28
    {
29
        $this->beConstructedWith($promotionRepository);
30
    }
31
32
    function it_implements_active_promotions_provider_interface(): void
33
    {
34
        $this->shouldImplement(PreQualifiedPromotionsProviderInterface::class);
35
    }
36
37
    function it_provides_active_promotions(
38
        PromotionRepositoryInterface $promotionRepository,
39
        PromotionInterface $promotion1,
40
        PromotionInterface $promotion2,
41
        PromotionSubjectInterface $subject
42
    ): void {
43
        $promotionRepository->findActive()->willReturn([$promotion1, $promotion2]);
44
45
        $this->getPromotions($subject)->shouldReturn([$promotion1, $promotion2]);
46
    }
47
}
48