Jobby\Tests\JobbyTest::testClosure PHP Метод

testClosure() публичный Метод

public testClosure ( )
    public function testClosure()
    {
        $jobby = new Jobby();
        $jobby->add('HelloWorldClosure', ['command' => static function () {
            echo 'A function!';
            return true;
        }, 'schedule' => '* * * * *', 'output' => $this->logFile]);
        $jobby->run();
        // Job runs asynchronously, so wait a bit
        sleep($this->getSleepTime());
        $this->assertEquals('A function!', $this->getLogContent());
    }