HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/qas.sports-crowd.com/vendor/react/event-loop/tests/ExtUvLoopTest.php
<?php

namespace React\Tests\EventLoop;

use React\EventLoop\ExtUvLoop;

class ExtUvLoopTest extends AbstractLoopTest
{
    public function createLoop()
    {
        if (!function_exists('uv_loop_new')) {
            $this->markTestSkipped('uv tests skipped because ext-uv is not installed.');
        }

        return new ExtUvLoop();
    }

    /** @dataProvider intervalProvider */
    public function testTimerInterval($interval, $expectedExceptionMessage)
    {
        $this->expectException('InvalidArgumentException');
        $this->expectExceptionMessage($expectedExceptionMessage);

        $this->loop
            ->addTimer(
                $interval,
                function () {
                    return 0;
                }
            );
    }

    public function intervalProvider()
    {
        $oversizeInterval = PHP_INT_MAX / 1000;
        $maxValue = (int) (PHP_INT_MAX / 1000);
        $oneMaxValue = $maxValue + 1;
        $tenMaxValue = $maxValue + 10;
        $tenMillionsMaxValue = $maxValue + 10000000;
        $intMax = PHP_INT_MAX;
        $oneIntMax = PHP_INT_MAX + 1;
        $tenIntMax = PHP_INT_MAX + 10;
        $oneHundredIntMax = PHP_INT_MAX + 100;
        $oneThousandIntMax = PHP_INT_MAX + 1000;
        $tenMillionsIntMax = PHP_INT_MAX + 10000000;
        $tenThousandsTimesIntMax = PHP_INT_MAX * 1000;

        return array(
            array(
                $oversizeInterval,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$oversizeInterval}' passed."
            ),
            array(
                $oneMaxValue,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$oneMaxValue}' passed.",
            ),
            array(
                $tenMaxValue,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$tenMaxValue}' passed.",
            ),
            array(
                $tenMillionsMaxValue,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$tenMillionsMaxValue}' passed.",
            ),
            array(
                $intMax,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$intMax}' passed.",
            ),
            array(
                $oneIntMax,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$oneIntMax}' passed.",
            ),
            array(
                $tenIntMax,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$tenIntMax}' passed.",
            ),
            array(
                $oneHundredIntMax,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$oneHundredIntMax}' passed.",
            ),
            array(
                $oneThousandIntMax,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$oneThousandIntMax}' passed.",
            ),
            array(
                $tenMillionsIntMax,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$tenMillionsIntMax}' passed.",
            ),
            array(
                $tenThousandsTimesIntMax,
                "Interval overflow, value must be lower than '{$maxValue}', but '{$tenThousandsTimesIntMax}' passed.",
            ),
        );
    }
}