Rx\Functional\Operator\CatchErrorTest::catchError_Error PHP Method

catchError_Error() public method

public catchError_Error ( )
    public function catchError_Error()
    {
        $error = new \Exception();
        $o1 = $this->createHotObservable([onNext(150, 1), onNext(210, 2), onNext(220, 3), onError(230, $error)]);
        $o2 = $this->createHotObservable([onNext(240, 5), onCompleted(250)]);
        $results = $this->scheduler->startWithCreate(function () use($o1, $o2) {
            return $o1->catchError(function () use($o2) {
                return $o2;
            });
        });
        $this->assertMessages([onNext(210, 2), onNext(220, 3), onNext(240, 5), onCompleted(250)], $results->getMessages());
    }