AbstractAlternativeProductsRestApiFixtures   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 12
dl 0
loc 32
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAlternativeProductConcreteTransfer() 0 3 1
A getProductConcreteTransfer() 0 3 1
A createAlternativeRelationBetweenProducts() 0 9 1
A buildFixtures() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace PyzTest\Glue\AlternativeProducts\RestApi;
11
12
use Generated\Shared\Transfer\ProductConcreteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\ProductConcreteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Generated\Shared\Transfer\StockProductTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\StockProductTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use PyzTest\Glue\AlternativeProducts\AlternativeProductsRestApiTester;
15
use SprykerTest\Shared\Testify\Fixtures\FixturesBuilderInterface;
16
use SprykerTest\Shared\Testify\Fixtures\FixturesContainerInterface;
17
18
/**
19
 * Auto-generated group annotations
20
 *
21
 * @group PyzTest
22
 * @group Glue
23
 * @group AlternativeProducts
24
 * @group RestApi
25
 * @group AbstractAlternativeProductsRestApiFixtures
26
 * Add your own group annotations below this line
27
 * @group EndToEnd
28
 */
29
class AbstractAlternativeProductsRestApiFixtures implements FixturesBuilderInterface, FixturesContainerInterface
30
{
31
    protected ProductConcreteTransfer $productConcreteTransfer;
32
33
    protected ProductConcreteTransfer $alternativeProductConcreteTransfer;
34
35
    public function getProductConcreteTransfer(): ProductConcreteTransfer
36
    {
37
        return $this->productConcreteTransfer;
38
    }
39
40
    public function getAlternativeProductConcreteTransfer(): ProductConcreteTransfer
41
    {
42
        return $this->alternativeProductConcreteTransfer;
43
    }
44
45
    public function buildFixtures(AlternativeProductsRestApiTester $I): FixturesContainerInterface
46
    {
47
        $this->createAlternativeRelationBetweenProducts($I);
48
49
        return $this;
50
    }
51
52
    protected function createAlternativeRelationBetweenProducts(AlternativeProductsRestApiTester $I): void
53
    {
54
        $this->productConcreteTransfer = $I->haveFullProduct();
55
        $I->haveProductInStock([StockProductTransfer::SKU => $this->productConcreteTransfer->getSku()]);
56
57
        $this->alternativeProductConcreteTransfer = $I->haveFullProduct();
58
        $I->haveProductInStock([StockProductTransfer::SKU => $this->alternativeProductConcreteTransfer->getSku()]);
59
60
        $I->haveProductAlternative($this->productConcreteTransfer, $this->alternativeProductConcreteTransfer->getAbstractSku());
61
    }
62
}
63