Skip to content

Commit a968dd3

Browse files
committed
remove the MightNotMakeAssertions shim
use expectNotToPerformAssertions() instead
1 parent 86338cf commit a968dd3

File tree

4 files changed

+5
-43
lines changed

4 files changed

+5
-43
lines changed

tests/MightNotMakeAssertions.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/Providers/Rng/CSRNGProviderTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@
66

77
use PHPUnit\Framework\TestCase;
88
use RobThree\Auth\Providers\Rng\CSRNGProvider;
9-
use Tests\MightNotMakeAssertions;
109

1110
class CSRNGProviderTest extends TestCase
1211
{
1312
use NeedsRngLengths;
14-
use MightNotMakeAssertions;
1513

1614
/**
1715
* @requires function random_bytes
18-
*
19-
* @return void
2016
*/
21-
public function testCSRNGProvidersReturnExpectedNumberOfBytes()
17+
public function testCSRNGProvidersReturnExpectedNumberOfBytes(): void
2218
{
2319
if (function_exists('random_bytes')) {
2420
$rng = new CSRNGProvider();
@@ -27,7 +23,7 @@ public function testCSRNGProvidersReturnExpectedNumberOfBytes()
2723
}
2824
$this->assertTrue($rng->isCryptographicallySecure());
2925
} else {
30-
$this->noAssertionsMade();
26+
$this->expectNotToPerformAssertions();
3127
}
3228
}
3329
}

tests/Providers/Time/ITimeProviderTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@
88
use RobThree\Auth\Algorithm;
99
use RobThree\Auth\TwoFactorAuth;
1010
use RobThree\Auth\TwoFactorAuthException;
11-
use Tests\MightNotMakeAssertions;
1211

1312
class ITimeProviderTest extends TestCase
1413
{
15-
use MightNotMakeAssertions;
16-
1714
public function testEnsureCorrectTimeDoesNotThrowForCorrectTime(): void
1815
{
16+
$this->expectNotToPerformAssertions();
1917
$tpr1 = new TestTimeProvider(123);
2018
$tpr2 = new TestTimeProvider(128);
2119

2220
$tfa = new TwoFactorAuth('Test', 6, 30, Algorithm::Sha1, null, null, $tpr1);
2321
$tfa->ensureCorrectTime(array($tpr2)); // 128 - 123 = 5 => within default leniency
24-
25-
$this->noAssertionsMade();
2622
}
2723

2824
public function testEnsureCorrectTimeThrowsOnIncorrectTime(): void
@@ -39,9 +35,9 @@ public function testEnsureCorrectTimeThrowsOnIncorrectTime(): void
3935

4036
public function testEnsureDefaultTimeProviderReturnsCorrectTime(): void
4137
{
38+
$this->expectNotToPerformAssertions();
4239
$tfa = new TwoFactorAuth('Test', 6, 30, Algorithm::Sha1);
4340
$tfa->ensureCorrectTime(array(new TestTimeProvider(time())), 1); // Use a leniency of 1, should the time change between both time() calls
4441

45-
$this->noAssertionsMade();
4642
}
4743
}

tests/TwoFactorAuthTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
class TwoFactorAuthTest extends TestCase
1414
{
15-
use MightNotMakeAssertions;
16-
1715
public function testConstructorThrowsOnInvalidDigits(): void
1816
{
1917
$this->expectException(TwoFactorAuthException::class);
@@ -45,7 +43,7 @@ public function testEnsureAllTimeProvidersReturnCorrectTime(): void
4543
//new \RobThree\Auth\Providers\Time\HttpTimeProvider('https://github.com'), // github.com will periodically report times that are off by more than 5 sec
4644
new \RobThree\Auth\Providers\Time\HttpTimeProvider('https://yahoo.com'),
4745
));
48-
$this->noAssertionsMade();
46+
$this->expectNotToPerformAssertions();
4947
}
5048

5149
public function testVerifyCodeWorksCorrectly(): void

0 commit comments

Comments
 (0)