Rx\Scheduler\EventLoopSchedulerTest::eventloop_schedule PHP Method

eventloop_schedule() public method

public eventloop_schedule ( )
    public function eventloop_schedule()
    {
        $loop = Factory::create();
        $scheduler = new EventLoopScheduler($loop);
        $actionCalled = false;
        $action = function () use(&$actionCalled) {
            $actionCalled = true;
            return "test";
        };
        $disposable = $scheduler->schedule($action);
        $this->assertInstanceOf('Rx\\DisposableInterface', $disposable);
        $this->assertFalse($actionCalled);
        $loop->tick();
        $this->assertTrue($actionCalled);
    }