Completed
Push — master ( c6b5de...db50e7 )
by Dmitry
04:45
created

tests/acceptance/seller/AccountRechargingCest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\finance\tests\acceptance\seller;
12
13
use hipanel\helpers\Url;
14
use hipanel\tests\_support\Step\Acceptance\Seller;
15
16 View Code Duplication
class AccountRechargingCest
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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