Passed
Push — master ( 679eaf...aeba21 )
by Ross
41:47
created

CheckQRCodeIsDisplayedTest::getAdminUserDataPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 4
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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\Admin\AccountEdit;
23
24
use Rossmitchell\Twofactor\Tests\Integration\Abstracts\AbstractTestClass;
25
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\AdminUserLoader;
26
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\ConfigurationLoader;
27
28 View Code Duplication
class CheckQRCodeIsDisplayedTest extends AbstractTestClass
0 ignored issues
show
Duplication introduced by
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...
29
{
30
    use AdminUserLoader;
31
    use ConfigurationLoader;
32
33
    public static function getAdminUserDataPath()
34
    {
35
        return __DIR__ . '/../_files/adminUser.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   loadAdminUsers
46
     * @magentoDataFixture   loadConfiguration
47
     */
48
    public function testQrCodeIsVisible()
49
    {
50
        $this->loginAdmin('two_factor_enabled', 'password123');
51
        $this->dispatch('/backend/admin/system_account/index/');
52
        $responseBody = $this->getResponse()->getBody();
53
        $this->assertContains('Your QR Code is', $responseBody);
54
    }
55
}
56