EntryStepTest::createEntryStep()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
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\Yves\Checkout\Process\Steps;
11
12
use Codeception\Test\Unit;
13
use Generated\Shared\Transfer\QuoteTransfer;
14
use Spryker\Client\Customer\CustomerClient;
15
use SprykerShop\Yves\CheckoutPage\Process\Steps\EntryStep;
16
use Symfony\Component\HttpFoundation\Request;
17
18
/**
19
 * Auto-generated group annotations
20
 *
21
 * @group PyzTest
22
 * @group Yves
23
 * @group Checkout
24
 * @group Process
25
 * @group Steps
26
 * @group EntryStepTest
27
 * Add your own group annotations below this line
28
 */
29
class EntryStepTest extends Unit
30
{
31
    /**
32
     * @return void
33
     */
34
    public function testRequireInputShouldReturnFalse(): void
35
    {
36
        $entryStep = $this->createEntryStep();
37
        $this->assertFalse($entryStep->requireInput(new QuoteTransfer()));
38
    }
39
40
    /**
41
     * @return void
42
     */
43
    public function testPostConditionShouldReturnTrue(): void
44
    {
45
        $entryStep = $this->createEntryStep();
46
47
        $this->assertTrue($entryStep->postCondition(new QuoteTransfer()));
48
    }
49
50
    /**
51
     * @return void
52
     */
53
    public function testPreConditionShouldReturnFalseIfCarIsEmpty(): void
54
    {
55
        $entryStep = $this->createEntryStep();
56
        $this->assertFalse($entryStep->preCondition(new QuoteTransfer()));
57
    }
58
59
    /**
60
     * @return \SprykerShop\Yves\CheckoutPage\Process\Steps\EntryStep
61
     */
62
    protected function createEntryStep(): EntryStep
63
    {
64
        return new EntryStep(
65
            'entry_route',
66
            'escape_route',
67
        );
68
    }
69
70
    /**
71
     * @return \Symfony\Component\HttpFoundation\Request
72
     */
73
    protected function createRequest(): Request
74
    {
75
        return Request::createFromGlobals();
76
    }
77
78
    /**
79
     * @return \Spryker\Client\Customer\CustomerClient
80
     */
81
    protected function createCustomerClient(): CustomerClient
82
    {
83
        return new CustomerClient();
84
    }
85
}
86