Path: blob/1.0-develop/tests/Unit/Helpers/IsDigitTest.php
7461 views
<?php12namespace Pterodactyl\Tests\Unit\Helpers;34use Pterodactyl\Tests\TestCase;56class IsDigitTest extends TestCase7{8/**9* Test the is_digit helper.10*/11#[\PHPUnit\Framework\Attributes\DataProvider('helperDataProvider')]12public function testHelper($value, $response)13{14$this->assertSame($response, is_digit($value));15}1617/**18* Provide data to test against the helper function.19*/20public static function helperDataProvider(): array21{22return [23[true, false],24[false, false],25[12.3, false],26['12.3', false],27['string', false],28[-1, false],29['-1', false],30[1, true],31[0, true],32[12345, true],33['12345', true],34['true', false],35['false', false],36['123_test', false],37['123.test', false],38['123test', false],39['test123', false],40['0x00000003', false],41[00000011, true],42['00000011', true],43['AD9C', false],44];45}46}474849