Rx\Functional\Operator\BufferWithCountTest::bufferWithCountbasic PHP Method

bufferWithCountbasic() public method

    public function bufferWithCountbasic()
    {
        $xs = $this->createHotObservable([onNext(100, 1), onNext(210, 2), onNext(240, 3), onNext(280, 4), onNext(320, 5), onNext(350, 6), onNext(380, 7), onNext(420, 8), onNext(470, 9), onCompleted(600)]);
        $results = $this->scheduler->startWithCreate(function () use($xs) {
            return $xs->bufferWithCount(3, 2);
        });
        $this->assertMessages([onNext(280, [2, 3, 4]), onNext(350, [4, 5, 6]), onNext(420, [6, 7, 8]), onNext(600, [8, 9]), onCompleted(600)], $results->getMessages());
        $this->assertSubscriptions([subscribe(200, 600)], $xs->getSubscriptions());
    }