Rx\Functional\Operator\DoOnCompletedTest::doOnCompleted_should_be_called PHP Method

doOnCompleted_should_be_called() public method

    public function doOnCompleted_should_be_called()
    {
        $xs = $this->createHotObservable([onNext(150, 1), onNext(210, 2), onNext(220, 3), onCompleted(250)]);
        $called = 0;
        $this->scheduler->startWithCreate(function () use($xs, &$called) {
            return $xs->doOnCompleted(function () use(&$called) {
                $called++;
            });
        });
        $this->assertEquals(1, $called);
    }