Passed
Pull Request — master (#365)
by Dmitry
21:01
created

createCustomer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 6
c 1
b 0
f 0
rs 10
cc 1
nc 1
nop 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
namespace PyzTest\Glue\AvailabilityNotifications\RestApi\Fixtures;
9
10
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...
11
use PyzTest\Glue\AvailabilityNotifications\AvailabilityNotificationsRestApiTester;
12
use SprykerTest\Shared\Testify\Fixtures\FixturesBuilderInterface;
13
use SprykerTest\Shared\Testify\Fixtures\FixturesContainerInterface;
14
15
/**
16
 * Auto-generated group annotations
17
 *
18
 * @group PyzTest
19
 * @group Glue
20
 * @group AvailabilityNotifications
21
 * @group RestApi
22
 * @group AvailabilityNotificationsApiFixtures
23
 * Add your own group annotations below this line
24
 * @group EndToEnd
25
 */
26
class AvailabilityNotificationsApiFixtures implements FixturesBuilderInterface, FixturesContainerInterface
27
{
28
    /**
29
     * @var string
30
     */
31
    protected const TEST_USERNAME = 'UserRestApiFixtures';
32
33
    /**
34
     * @var string
35
     */
36
    protected const TEST_PASSWORD = 'change123';
37
38
    /**
39
     * @var \Generated\Shared\Transfer\CustomerTransfer
40
     */
41
    protected CustomerTransfer $customerTransfer;
42
43
    /**
44
     * @return \Generated\Shared\Transfer\CustomerTransfer
45
     */
46
    public function getCustomerTransfer(): CustomerTransfer
47
    {
48
        return $this->customerTransfer;
49
    }
50
51
    /**
52
     * @param \PyzTest\Glue\AvailabilityNotifications\AvailabilityNotificationsRestApiTester $I
53
     *
54
     * @return \SprykerTest\Shared\Testify\Fixtures\FixturesContainerInterface
55
     */
56
    public function buildFixtures(AvailabilityNotificationsRestApiTester $I): FixturesContainerInterface
57
    {
58
        $this->customerTransfer = $this->createCustomer($I);
59
        $this->customerTransfer = $I->confirmCustomer($this->customerTransfer);
60
61
        return $this;
62
    }
63
64
    /**
65
     * @param \PyzTest\Glue\AvailabilityNotifications\AvailabilityNotificationsRestApiTester $I
66
     *
67
     * @return \Generated\Shared\Transfer\CustomerTransfer
68
     */
69
    protected function createCustomer(AvailabilityNotificationsRestApiTester $I): CustomerTransfer
70
    {
71
        return $I->haveCustomer([
72
            CustomerTransfer::USERNAME => static::TEST_USERNAME,
73
            CustomerTransfer::PASSWORD => static::TEST_PASSWORD,
74
            CustomerTransfer::NEW_PASSWORD => static::TEST_PASSWORD,
75
        ]);
76
    }
77
}
78