Skip to content

Commit f6da6be

Browse files
committed
remove pointless test rng class
we were testing a test class, which didn't make a lot of sense.
1 parent e44997c commit f6da6be

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

tests/Providers/Rng/CSRNGProviderTest.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,11 @@ class CSRNGProviderTest extends TestCase
1111
{
1212
use NeedsRngLengths;
1313

14-
/**
15-
* @requires function random_bytes
16-
*/
1714
public function testCSRNGProvidersReturnExpectedNumberOfBytes(): void
1815
{
19-
if (function_exists('random_bytes')) {
20-
$rng = new CSRNGProvider();
21-
foreach ($this->rngTestLengths as $l) {
22-
$this->assertSame($l, strlen($rng->getRandomBytes($l)));
23-
}
24-
} else {
25-
$this->expectNotToPerformAssertions();
16+
$rng = new CSRNGProvider();
17+
foreach ($this->rngTestLengths as $l) {
18+
$this->assertSame($l, strlen($rng->getRandomBytes($l)));
2619
}
2720
}
2821
}

tests/Providers/Rng/IRNGProviderTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,4 @@ public function testCreateSecret(): void
1515
$tfa = new TwoFactorAuth('Test', 6, 30, Algorithm::Sha1, null, null);
1616
$this->assertIsString($tfa->createSecret());
1717
}
18-
19-
public function testCreateSecretGeneratesDesiredAmountOfEntropy(): void
20-
{
21-
$rng = new TestRNGProvider();
22-
23-
$tfa = new TwoFactorAuth('Test', 6, 30, Algorithm::Sha1, null, $rng);
24-
$this->assertSame('A', $tfa->createSecret(5));
25-
$this->assertSame('AB', $tfa->createSecret(6));
26-
$this->assertSame('ABCDEFGHIJKLMNOPQRSTUVWXYZ', $tfa->createSecret(128));
27-
$this->assertSame('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', $tfa->createSecret(160));
28-
$this->assertSame('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', $tfa->createSecret(320));
29-
$this->assertSame('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567ABCDEFGHIJKLMNOPQRSTUVWXYZ234567A', $tfa->createSecret(321));
30-
}
3118
}

tests/Providers/Rng/TestRNGProvider.php

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

0 commit comments

Comments
 (0)