Files
php-uuid/tests/Generator/MtRandGeneratorTest.php
T
Martin Hujer ca2629767d Require phpstan and correct issues found up to level 2
* issues found by phpstan L0
* issues found by phpstan L1
* issues found by phpstan L2 in src/
* issues found by phpstan L2 in tests/
2020-01-18 12:13:08 -06:00

37 lines
777 B
PHP

<?php
namespace Ramsey\Uuid\Test\Generator;
use Ramsey\Uuid\Generator\MtRandGenerator;
use Ramsey\Uuid\Test\TestCase;
/**
* Class MtRandGeneratorTest
* @package Ramsey\Uuid\Test\Generator
* @covers Ramsey\Uuid\Generator\MtRandGenerator
*/
class MtRandGeneratorTest extends TestCase
{
public function lengthDataProvider()
{
return [
[0],
[1],
[2],
[16],
[1000]
];
}
/**
* @dataProvider lengthDataProvider
* @param int $length
*/
public function testGenerateReturnsStringOfGivenLength($length)
{
$generator = new MtRandGenerator();
$returned = $generator->generate($length);
$this->assertEquals($length, strlen($returned));
}
}