PaymentMethodsFixtures   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 21
dl 0
loc 29
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildFixtures() 0 27 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\Checkout\RestApi\Fixtures;
11
12
use Generated\Shared\Transfer\PaymentMethodTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentMethodTransfer 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\PaymentProviderTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentProviderTransfer 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\Checkout\CheckoutApiTester;
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 Checkout
24
 * @group RestApi
25
 * @group PaymentMethodsFixtures
26
 * Add your own group annotations below this line
27
 * @group EndToEnd
28
 */
29
class PaymentMethodsFixtures implements FixturesBuilderInterface, FixturesContainerInterface
30
{
31
    public function buildFixtures(CheckoutApiTester $I): FixturesContainerInterface
32
    {
33
        $paymentProviderTransfer = $I->havePaymentProvider([
34
            PaymentProviderTransfer::PAYMENT_PROVIDER_KEY => 'DummyPayment',
35
            PaymentProviderTransfer::NAME => 'dummyPayment',
36
        ]);
37
        $I->havePaymentMethodWithStore([
38
            PaymentMethodTransfer::IS_ACTIVE => true,
39
            PaymentMethodTransfer::PAYMENT_METHOD_KEY => 'dummyPaymentInvoice',
40
            PaymentMethodTransfer::NAME => 'Invoice',
41
            PaymentMethodTransfer::ID_PAYMENT_PROVIDER => $paymentProviderTransfer->getIdPaymentProvider(),
42
        ]);
43
        $I->havePaymentMethodWithStore([
44
            PaymentMethodTransfer::IS_ACTIVE => true,
45
            PaymentMethodTransfer::PAYMENT_METHOD_KEY => 'dummyPaymentCreditCard',
46
            PaymentMethodTransfer::NAME => 'Credit Card',
47
            PaymentMethodTransfer::ID_PAYMENT_PROVIDER => $paymentProviderTransfer->getIdPaymentProvider(),
48
        ]);
49
        $I->havePaymentMethodWithStore([
50
            PaymentMethodTransfer::IS_ACTIVE => true,
51
            PaymentMethodTransfer::PAYMENT_METHOD_KEY => 'foreignPaymentCreditCard',
52
            PaymentMethodTransfer::NAME => 'Foreign Credit Card',
53
            PaymentMethodTransfer::ID_PAYMENT_PROVIDER => $paymentProviderTransfer->getIdPaymentProvider(),
54
            PaymentMethodTransfer::IS_FOREIGN => true,
55
        ]);
56
57
        return $this;
58
    }
59
}
60