Rx\Functional\Operator\ReduceTest::reduce_with_seed_throw PHP Method

reduce_with_seed_throw() public method

    public function reduce_with_seed_throw()
    {
        $ex = new \Exception('ex');
        $xs = $this->createHotObservable([onNext(150, 1), onError(210, $ex)]);
        $results = $this->scheduler->startWithCreate(function () use($xs) {
            return $xs->reduce(function ($acc, $x) {
                return $acc + $x;
            }, 42);
        });
        $this->assertMessages([onError(210, $ex)], $results->getMessages());
    }