Passed
Push — master ( aeba21...9e76ce )
by Ross
47:24
created

OptionShouldShowWhenEnabledTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCustomerDataPath() 0 4 1
A getConfigurationDataPath() 0 4 1
A testUseTwoFactorIsDisplayed() 0 8 1
1
<?php
2
/**
3
 * A two factor authentication module that protects both the admin and customer logins
4
 * Copyright (C) 2017  Ross Mitchell
5
 *
6
 * This file is part of Rossmitchell/Twofactor.
7
 *
8
 * Rossmitchell/Twofactor is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
namespace Rossmitchell\Twofactor\Tests\Integration\Customer\EditAccountPage;
23
24
use Rossmitchell\Twofactor\Tests\Integration\Abstracts\AbstractTestClass;
25
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\ConfigurationLoader;
26
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\CustomerLoader;
27
28
class OptionShouldShowWhenEnabledTest extends AbstractTestClass
29
{
30
    use ConfigurationLoader;
31
    use CustomerLoader;
32
33
    public static function getCustomerDataPath()
34
    {
35
        return __DIR__.'/../_files/customer.php';
36
    }
37
38
    public static function getConfigurationDataPath()
39
    {
40
        return __DIR__.'/../_files/two_factor_enabled.php';
41
    }
42
43
    /**
44
     * @magentoDbIsolation enabled
45
     * @magentoDataFixture loadCustomer
46
     * @magentoDataFixture loadConfiguration
47
     */
48
    public function testUseTwoFactorIsDisplayed()
49
    {
50
        $this->login('[email protected]');
51
        $this->dispatch('/customer/account/edit');
52
        $body = $this->getResponse()->getBody();
53
        $this->assertContains('Use Two Factor Authentication', $body);
54
        $this->assertNotContains('Please scan the image below to get your authentication code', $body);
55
    }
56
}
57