Rx\Functional\Operator\AsObservableTest::testAsObservablePassThroughScheduler PHP Method

testAsObservablePassThroughScheduler() public method

    public function testAsObservablePassThroughScheduler()
    {
        $loop = Factory::create();
        $scheduler = new EventLoopScheduler($loop);
        $gotValue = false;
        Observable::interval(10)->asObservable()->take(1)->subscribe(new CallbackObserver(function ($x) use(&$gotValue) {
            $this->assertEquals(0, $x);
            $gotValue = true;
        }), $scheduler);
        $loop->run();
        $this->assertTrue($gotValue);
    }