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

reduce_without_seed_empty() public method

    public function reduce_without_seed_empty()
    {
        $xs = $this->createHotObservable([onNext(150, 1), onCompleted(250)]);
        /** @var $results MockObserver * */
        $results = $this->scheduler->startWithCreate(function () use($xs) {
            return $xs->reduce(function ($acc, $x) {
                return $acc + $x;
            });
        });
        $messages = $results->getMessages();
        $this->assertEquals(1, count($messages));
        $this->assertTrue($messages[0] instanceof Recorded && $messages[0]->getValue() instanceof OnErrorNotification);
        $this->assertEquals(250, $messages[0]->getTime());
    }