AccessTokensRestApiFixtures   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 45
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCustomerTransfer() 0 3 1
A createCustomerTransfer() 0 8 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\Auth\RestApi;
11
12
use Generated\Shared\Transfer\CustomerTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\CustomerTransfer 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 PyzTest\Glue\Auth\AuthRestApiTester;
14
use SprykerTest\Shared\Testify\Fixtures\FixturesBuilderInterface;
15
use SprykerTest\Shared\Testify\Fixtures\FixturesContainerInterface;
16
17
class AccessTokensRestApiFixtures implements FixturesBuilderInterface, FixturesContainerInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    public const TEST_PASSWORD = 'change123';
23
24
    /**
25
     * @var \Generated\Shared\Transfer\CustomerTransfer
26
     */
27
    protected CustomerTransfer $customerTransfer;
28
29
    /**
30
     * @param \PyzTest\Glue\Auth\AuthRestApiTester $I
31
     *
32
     * @return \SprykerTest\Shared\Testify\Fixtures\FixturesContainerInterface
33
     */
34
    public function buildFixtures(AuthRestApiTester $I): FixturesContainerInterface
35
    {
36
        $this->customerTransfer = $this->createCustomerTransfer($I);
37
38
        return $this;
39
    }
40
41
    /**
42
     * @return \Generated\Shared\Transfer\CustomerTransfer
43
     */
44
    public function getCustomerTransfer(): CustomerTransfer
45
    {
46
        return $this->customerTransfer;
47
    }
48
49
    /**
50
     * @param \PyzTest\Glue\Auth\AuthRestApiTester $I
51
     *
52
     * @return \Generated\Shared\Transfer\CustomerTransfer
53
     */
54
    protected function createCustomerTransfer(AuthRestApiTester $I): CustomerTransfer
55
    {
56
        $customerTransfer = $I->haveCustomer([
57
            CustomerTransfer::PASSWORD => static::TEST_PASSWORD,
58
            CustomerTransfer::NEW_PASSWORD => static::TEST_PASSWORD,
59
        ]);
60
61
        return $I->confirmCustomer($customerTransfer);
62
    }
63
}
64