mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-02 17:56:09 +01:00
45 lines
682 B
PHP
45 lines
682 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Math;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Math;
|
|
|
|
final class AbsTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideData
|
|
*/
|
|
public function testAbs($expected, $number): void
|
|
{
|
|
static::assertSame($expected, Math\abs($number));
|
|
}
|
|
|
|
public function provideData(): array
|
|
{
|
|
return [
|
|
[
|
|
5,
|
|
5
|
|
],
|
|
|
|
[
|
|
5,
|
|
-5
|
|
],
|
|
|
|
[
|
|
5.5,
|
|
-5.5
|
|
],
|
|
|
|
[
|
|
10.5,
|
|
10.5
|
|
]
|
|
];
|
|
}
|
|
}
|