Code Duplication    Length = 30-31 lines in 2 locations

src/Tests/Integration/Admin/EnterCodePage/EnabledForSystemEnabledForCustomerTest.php 1 location

@@ 29-59 (lines=31) @@
26
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\ConfigurationLoader;
27
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\CustomerLoader;
28
29
class EnabledForSystemEnabledForCustomerTest extends AbstractTestClass
30
{
31
    use AdminUserLoader;
32
    use ConfigurationLoader;
33
34
    public static function getAdminUserDataPath()
35
    {
36
        return __DIR__ . '/../_files/adminUser.php';
37
    }
38
39
    public static function getConfigurationDataPath()
40
    {
41
        return __DIR__.'/../_files/two_factor_enabled.php';
42
    }
43
44
    /**
45
     * @magentoDbIsolation   enabled
46
     * @magentoDataFixture   loadAdminUsers
47
     * @magentoDataFixture   loadConfiguration
48
     */
49
    public function testPageLoadsCorrectly()
50
    {
51
        $this->loginAdmin('two_factor_enabled');
52
        $this->dispatch('/backend/twofactor/adminlogin/index');
53
        $responseBody = $this->getResponse()->getBody();
54
55
        $this->assertFalse($this->getResponse()->isRedirect());
56
        $this->assertContains('Two Factor Authentication', $responseBody);
57
        $this->assertContains('Please enter your code', $responseBody);
58
    }
59
}
60

src/Tests/Integration/Customer/EnterCodePage/EnabledForSystemEnabledForCustomerTest.php 1 location

@@ 28-57 (lines=30) @@
25
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\ConfigurationLoader;
26
use Rossmitchell\Twofactor\Tests\Integration\FixtureLoader\Traits\CustomerLoader;
27
28
class EnabledForSystemEnabledForCustomerTest extends AbstractTestClass
29
{
30
    use CustomerLoader;
31
    use ConfigurationLoader;
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 testPageLoadsCorrectly()
49
    {
50
        $this->login('[email protected]');
51
        $this->dispatch('/twofactor/customerlogin/index');
52
        $responseBody = $this->getResponse()->getBody();
53
        $this->assertFalse($this->getResponse()->isRedirect());
54
        $this->assertContains('Two Factor Authentication', $responseBody);
55
        $this->assertContains('Please enter your code', $responseBody);
56
    }
57
}
58