Code Duplication    Length = 28-28 lines in 3 locations

src/Tests/Integration/Admin/AccountEdit/CheckQRCodeIsDisplayedTest.php 1 location

@@ 28-55 (lines=28) @@
25
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\AdminUserLoader;
26
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\ConfigurationLoader;
27
28
class CheckQRCodeIsDisplayedTest extends AbstractTestClass
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

src/Tests/Integration/Admin/AccountEdit/CheckQRCodeIsNotDisplayedTest.php 1 location

@@ 28-55 (lines=28) @@
25
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\AdminUserLoader;
26
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\ConfigurationLoader;
27
28
class CheckQRCodeIsNotDisplayedTest extends AbstractTestClass
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 testQrCodeIsNotDisplayed()
49
    {
50
        $this->loginAdmin('two_factor_disabled', 'password123');
51
        $this->dispatch('/backend/admin/system_account/index/');
52
        $responseBody = $this->getResponse()->getBody();
53
        $this->assertNotContains('Your QR Code is', $responseBody);
54
    }
55
}
56

src/Tests/Integration/Admin/AccountEdit/CheckQRCodeIsNotDisplayedWhenDisabledTest.php 1 location

@@ 28-55 (lines=28) @@
25
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\AdminUserLoader;
26
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\ConfigurationLoader;
27
28
class CheckQRCodeIsNotDisplayedWhenDisabledTest extends AbstractTestClass
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_disabled.php';
41
    }
42
43
    /**
44
     * @magentoDbIsolation   enabled
45
     * @magentoDataFixture   loadAdminUsers
46
     * @magentoDataFixture   loadConfiguration
47
     */
48
    public function testQrCodeIsNotDisplayed()
49
    {
50
        $this->loginAdmin('two_factor_enabled', 'password123');
51
        $this->dispatch('/backend/admin/system_account/index/');
52
        $responseBody = $this->getResponse()->getBody();
53
        $this->assertNotContains('Your QR Code is', $responseBody);
54
    }
55
}
56