Skip to content

Commit

Permalink
Add test for functions (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Mar 5, 2019
1 parent dcd791c commit cfc7c11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,19 @@ public function test_it_can_format_bytes(int $bytes, string $expected): void
/**
* @dataProvider provideMemory
*/
public function test_it_can_convet_a_memory_limit_amount_to_bytes(string $memory, int $expected): void
public function test_it_can_convert_a_memory_limit_amount_to_bytes(string $memory, int $expected): void
{
$actual = memory_to_bytes($memory);

$this->assertSame($expected, $actual);
}

public function test_it_can_generate_a_unique_id(): void
{
$this->assertRegExp('/^(?:[a-z]|\d){12}$/', unique_id(''));
$this->assertRegExp('/^Box(?:[a-z]|\d){12}$/', unique_id('Box'));
}

public function providePharCompressionAlgorithm(): Generator
{
yield [Phar::GZ, 'zlib'];
Expand Down

0 comments on commit cfc7c11

Please sign in to comment.