Jobby\Tests\JobbyTest::testSuperClosure PHP Method

testSuperClosure() public method

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