PaymentMethodsFixtures   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 21
dl 0
loc 34
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
    /**
32
     * @param \PyzTest\Glue\Checkout\CheckoutApiTester $I
33
     *
34
     * @return \SprykerTest\Shared\Testify\Fixtures\FixturesContainerInterface
35
     */
36
    public function buildFixtures(CheckoutApiTester $I): FixturesContainerInterface
37
    {
38
        $paymentProviderTransfer = $I->havePaymentProvider([
39
            PaymentProviderTransfer::PAYMENT_PROVIDER_KEY => 'DummyPayment',
40
            PaymentProviderTransfer::NAME => 'dummyPayment',
41
        ]);
42
        $I->havePaymentMethodWithStore([
43
            PaymentMethodTransfer::IS_ACTIVE => true,
44
            PaymentMethodTransfer::PAYMENT_METHOD_KEY => 'dummyPaymentInvoice',
45
            PaymentMethodTransfer::NAME => 'Invoice',
46
            PaymentMethodTransfer::ID_PAYMENT_PROVIDER => $paymentProviderTransfer->getIdPaymentProvider(),
47
        ]);
48
        $I->havePaymentMethodWithStore([
49
            PaymentMethodTransfer::IS_ACTIVE => true,
50
            PaymentMethodTransfer::PAYMENT_METHOD_KEY => 'dummyPaymentCreditCard',
51
            PaymentMethodTransfer::NAME => 'Credit Card',
52
            PaymentMethodTransfer::ID_PAYMENT_PROVIDER => $paymentProviderTransfer->getIdPaymentProvider(),
53
        ]);
54
        $I->havePaymentMethodWithStore([
55
            PaymentMethodTransfer::IS_ACTIVE => true,
56
            PaymentMethodTransfer::PAYMENT_METHOD_KEY => 'foreignPaymentCreditCard',
57
            PaymentMethodTransfer::NAME => 'Foreign Credit Card',
58
            PaymentMethodTransfer::ID_PAYMENT_PROVIDER => $paymentProviderTransfer->getIdPaymentProvider(),
59
            PaymentMethodTransfer::IS_FOREIGN => true,
60
        ]);
61
62
        return $this;
63
    }
64
}
65