|
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\PropertyBuilder; |
|
14
|
|
|
|
|
15
|
|
|
use BitBag\SyliusElasticsearchPlugin\EntityRepository\ProductVariantRepositoryInterface; |
|
16
|
|
|
use BitBag\SyliusElasticsearchPlugin\PropertyBuilder\AbstractBuilder; |
|
17
|
|
|
use BitBag\SyliusElasticsearchPlugin\PropertyBuilder\Mapper\ProductTaxonsMapperInterface; |
|
18
|
|
|
use BitBag\SyliusElasticsearchPlugin\PropertyBuilder\OptionTaxonsBuilder; |
|
19
|
|
|
use BitBag\SyliusElasticsearchPlugin\PropertyBuilder\PropertyBuilderInterface; |
|
20
|
|
|
use FOS\ElasticaBundle\Event\TransformEvent; |
|
21
|
|
|
use PhpSpec\ObjectBehavior; |
|
22
|
|
|
use Sylius\Component\Resource\Repository\RepositoryInterface; |
|
23
|
|
|
|
|
24
|
|
|
final class OptionTaxonsBuilderSpec extends ObjectBehavior |
|
25
|
|
|
{ |
|
26
|
|
|
function let( |
|
|
|
|
|
|
27
|
|
|
RepositoryInterface $productOptionValueRepository, |
|
28
|
|
|
ProductVariantRepositoryInterface $productVariantRepository, |
|
29
|
|
|
ProductTaxonsMapperInterface $productTaxonsMapper |
|
30
|
|
|
): void { |
|
31
|
|
|
$this->beConstructedWith( |
|
32
|
|
|
$productOptionValueRepository, |
|
33
|
|
|
$productVariantRepository, |
|
34
|
|
|
$productTaxonsMapper, |
|
35
|
|
|
'option', |
|
36
|
|
|
'taxons' |
|
37
|
|
|
); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
function it_is_initializable(): void |
|
|
|
|
|
|
41
|
|
|
{ |
|
42
|
|
|
$this->shouldHaveType(OptionTaxonsBuilder::class); |
|
43
|
|
|
$this->shouldHaveType(AbstractBuilder::class); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
function it_implements_property_builder_interface(): void |
|
47
|
|
|
{ |
|
48
|
|
|
$this->shouldHaveType(PropertyBuilderInterface::class); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
function it_consumes_event(TransformEvent $event): void |
|
52
|
|
|
{ |
|
53
|
|
|
$this->consumeEvent($event); |
|
|
|
|
|
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.