AvailabilityNotificationsApiFixtures   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

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

3 Methods

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