1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 17:12:30 +01:00
Pterodactyl-Panel/tests/Unit/Helpers/IsDigitTest.php
Matthew Penner cbcf62086f
Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-14 10:59:20 -06:00

49 lines
1.1 KiB
PHP

<?php
namespace Pterodactyl\Tests\Unit\Helpers;
use Pterodactyl\Tests\TestCase;
class IsDigitTest extends TestCase
{
/**
* Test the is_digit helper.
*
* @dataProvider helperDataProvider
*/
public function testHelper($value, $response)
{
$this->assertSame($response, is_digit($value));
}
/**
* Provide data to test against the helper function.
*/
public function helperDataProvider(): array
{
return [
[true, false],
[false, false],
[12.3, false],
['12.3', false],
['string', false],
[-1, false],
['-1', false],
[1, true],
[0, true],
[12345, true],
['12345', true],
['true', false],
['false', false],
['123_test', false],
['123.test', false],
['123test', false],
['test123', false],
['0x00000003', false],
[00000011, true],
['00000011', true],
['AD9C', false],
];
}
}