Skip to content

Commit f542788

Browse files
committed
fix formatting
1 parent ab51d16 commit f542788

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

tests/TwoFactorAuthTest.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use PHPUnit\Framework\TestCase;
88
use ReflectionMethod;
99
use RobThree\Auth\Algorithm;
10+
use RobThree\Auth\Providers\Time\HttpTimeProvider;
11+
use RobThree\Auth\Providers\Time\NTPTimeProvider;
1012
use RobThree\Auth\TwoFactorAuth;
1113
use RobThree\Auth\TwoFactorAuthException;
1214

@@ -37,11 +39,11 @@ public function testEnsureAllTimeProvidersReturnCorrectTime(): void
3739
{
3840
$tfa = new TwoFactorAuth('Test', 6, 30, Algorithm::Sha1);
3941
$tfa->ensureCorrectTime(array(
40-
new \RobThree\Auth\Providers\Time\NTPTimeProvider(), // Uses pool.ntp.org by default
42+
new NTPTimeProvider(), // Uses pool.ntp.org by default
4143
//new \RobThree\Auth\Providers\Time\NTPTimeProvider('time.google.com'), // Somehow time.google.com and time.windows.com make travis timeout??
42-
new \RobThree\Auth\Providers\Time\HttpTimeProvider(), // Uses google.com by default
44+
new HttpTimeProvider(), // Uses google.com by default
4345
//new \RobThree\Auth\Providers\Time\HttpTimeProvider('https://github.com'), // github.com will periodically report times that are off by more than 5 sec
44-
new \RobThree\Auth\Providers\Time\HttpTimeProvider('https://yahoo.com'),
46+
new HttpTimeProvider('https://yahoo.com'),
4547
));
4648
$this->expectNotToPerformAssertions();
4749
}
@@ -50,19 +52,19 @@ public function testVerifyCodeWorksCorrectly(): void
5052
{
5153
$tfa = new TwoFactorAuth('Test', 6, 30);
5254
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847190));
53-
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 0, 1426847190 + 29)); //Test discrepancy
54-
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 0, 1426847190 + 30)); //Test discrepancy
55-
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 0, 1426847190 - 1)); //Test discrepancy
55+
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 0, 1426847190 + 29)); //Test discrepancy
56+
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 0, 1426847190 + 30)); //Test discrepancy
57+
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 0, 1426847190 - 1)); //Test discrepancy
5658

57-
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 + 0)); //Test discrepancy
58-
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 + 35)); //Test discrepancy
59-
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 - 35)); //Test discrepancy
59+
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 + 0)); //Test discrepancy
60+
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 + 35)); //Test discrepancy
61+
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 - 35)); //Test discrepancy
6062

61-
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 + 65)); //Test discrepancy
62-
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 - 65)); //Test discrepancy
63+
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 + 65)); //Test discrepancy
64+
$this->assertFalse($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 1, 1426847205 - 65)); //Test discrepancy
6365

64-
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 2, 1426847205 + 65)); //Test discrepancy
65-
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 2, 1426847205 - 65)); //Test discrepancy
66+
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 2, 1426847205 + 65)); //Test discrepancy
67+
$this->assertTrue($tfa->verifyCode('VMR466AB62ZBOKHE', '543160', 2, 1426847205 - 65)); //Test discrepancy
6668
}
6769

6870
public function testVerifyCorrectTimeSliceIsReturned(): void

0 commit comments

Comments
 (0)