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

reduce_with_seed_range() public method

    public function reduce_with_seed_range()
    {
        $xs = $this->createHotObservable([onNext(150, 1), onNext(210, 0), onNext(220, 1), onNext(230, 2), onNext(240, 3), onNext(250, 4), onCompleted(260)]);
        $results = $this->scheduler->startWithCreate(function () use($xs) {
            return $xs->reduce(function ($acc, $x) {
                return $acc + $x;
            }, 42);
        });
        $this->assertMessages([onNext(260, 10 + 42), onCompleted(260)], $results->getMessages());
    }