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