mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-02 17:56:09 +01:00
50 lines
771 B
PHP
50 lines
771 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Math;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Math;
|
|
|
|
class FloorTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideData
|
|
*/
|
|
public function testFloor(float $expected, float $number): void
|
|
{
|
|
self::assertSame($expected, Math\floor($number));
|
|
}
|
|
|
|
public function provideData(): array
|
|
{
|
|
return [
|
|
[
|
|
4,
|
|
4.3,
|
|
],
|
|
|
|
[
|
|
9,
|
|
9.9,
|
|
],
|
|
|
|
[
|
|
3,
|
|
Math\PI
|
|
],
|
|
|
|
[
|
|
-4,
|
|
-Math\PI
|
|
],
|
|
|
|
[
|
|
2,
|
|
Math\E
|
|
]
|
|
];
|
|
}
|
|
}
|