mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-16 16:17:43 +03:00
added test with multiple cases for generate
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Ramsey\Uuid\Test\Generator;
|
||||
|
||||
use Ramsey\Uuid\Generator\MtRandGenerator;
|
||||
|
||||
class MtRandGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function lengthDataProvider()
|
||||
{
|
||||
return [
|
||||
[0],
|
||||
[1],
|
||||
[2],
|
||||
[16],
|
||||
[1000]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider lengthDataProvider
|
||||
*/
|
||||
public function testGenerateReturnsStringOfGivenLength($length)
|
||||
{
|
||||
$generator = new MtRandGenerator();
|
||||
$returned = $generator->generate($length);
|
||||
$this->assertEquals($length, strlen($returned));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user