Code Duplication    Length = 36-36 lines in 2 locations

tests/acceptance/client/AccountRechargingCest.php 1 location

@@ 16-51 (lines=36) @@
13
use hipanel\helpers\Url;
14
use hipanel\tests\_support\Step\Acceptance\Client;
15
16
class AccountRechargingCest
17
{
18
    public function ensureIndexPageWorks(Client $I)
19
    {
20
        $I->login();
21
        $I->needPage(Url::to('@pay/deposit'));
22
        $I->see('Account recharging', 'h1');
23
        $this->ensureICanSeeDepositBox($I);
24
        $this->ensureICanSeePaymentBox($I);
25
        $this->ensureICanSeeWarningBox($I);
26
    }
27
28
    private function ensureICanSeeDepositBox(Client $I)
29
    {
30
        $url = Url::to('@pay/deposit');
31
        $form = "//form[@action='$url']";
32
        $I->see('Amount', "$form/label");
33
        $I->seeElement('input', ['id' => 'depositform-amount']);
34
        $text = 'Enter the amount of the replenishment in USD. For example: 8.79';
35
        $I->see($text, $form);
36
        $I->see('Proceed', "$form/button[@type='submit']");
37
    }
38
39
    private function ensureICanSeePaymentBox(Client $I)
40
    {
41
        $I->see('Available payment methods', 'h3');
42
        $I->see('We support fully automatic account depositing with the following payment systems:');
43
    }
44
45
    private function ensureICanSeeWarningBox(Client $I)
46
    {
47
        $I->see('Important information', 'h4');
48
        $text = 'Remember to return to the site after successful payment!';
49
        $I->see($text, 'p');
50
    }
51
}
52

tests/acceptance/seller/AccountRechargingCest.php 1 location

@@ 16-51 (lines=36) @@
13
use hipanel\helpers\Url;
14
use hipanel\tests\_support\Step\Acceptance\Seller;
15
16
class AccountRechargingCest
17
{
18
    public function ensureIndexPageWorks(Seller $I)
19
    {
20
        $I->login();
21
        $I->needPage(Url::to('@pay/deposit'));
22
        $I->see('Account recharging', 'h1');
23
        $this->ensureICanSeeDepositBox($I);
24
        $this->ensureICanSeePaymentBox($I);
25
        $this->ensureICanSeeWarningBox($I);
26
    }
27
28
    private function ensureICanSeeDepositBox(Seller $I)
29
    {
30
        $url = Url::to('@pay/deposit');
31
        $form = "//form[@action='$url']";
32
        $I->see('Amount', "$form/label");
33
        $I->seeElement('input', ['id' => 'depositform-amount']);
34
        $text = 'Enter the amount of the replenishment in USD. For example: 8.79';
35
        $I->see($text, $form);
36
        $I->see('Proceed', "$form/button[@type='submit']");
37
    }
38
39
    private function ensureICanSeePaymentBox(Seller $I)
40
    {
41
        $I->see('Available payment methods', 'h3');
42
        $I->see('We support fully automatic account depositing with the following payment systems:');
43
    }
44
45
    private function ensureICanSeeWarningBox(Seller $I)
46
    {
47
        $I->see('Important information', 'h4');
48
        $text = 'Remember to return to the site after successful payment!';
49
        $I->see($text, 'p');
50
    }
51
}
52