[Random] increase code coverage

This commit is contained in:
azjezz 2019-12-26 15:41:15 +01:00
parent 441c0cadae
commit 1d27476584
2 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,11 @@ class BytesTest extends TestCase
self::assertSame(32, Str\Byte\length($random));
}
public function testBytesEarlyReturnForZeroLength(): void
{
self::assertSame('', Random\bytes(0));
}
public function testBytesThrowsForNegativeLength(): void
{
$this->expectException(Exception\InvariantViolationException::class);

View File

@ -31,6 +31,11 @@ class StringTest extends TestCase
}
}
public function testStringEarlyReturnForZeroLength(): void
{
self::assertSame('', Random\string(0));
}
public function testStringThrowsForNegativeLength(): void
{
$this->expectException(Exception\InvariantViolationException::class);