Rx\Functional\Operator\ConcatTest::testConcatAsArguments PHP Method

testConcatAsArguments() public method

    public function testConcatAsArguments()
    {
        $xs1 = $this->createColdObservable([onNext(10, 1), onNext(20, 2), onNext(30, 3), onCompleted(40)]);
        $xs2 = $this->createColdObservable([onNext(10, 4), onNext(20, 5), onCompleted(30)]);
        $xs3 = $this->createColdObservable([onNext(10, 6), onNext(20, 7), onNext(30, 8), onNext(40, 9), onCompleted(50)]);
        $results = $this->scheduler->startWithCreate(function () use($xs1, $xs2, $xs3) {
            return (new EmptyObservable())->concat($xs1)->concat($xs2)->concat($xs3);
        });
        // Note: these tests differ from the RxJS tests that they were based on because RxJS was
        // explicitly using the immediate scheduler on subscribe internally. When we pass the
        // proper scheduler in, the subscription gets scheduled which requires an extra tick.
        $this->assertMessages([onNext(211, 1), onNext(221, 2), onNext(231, 3), onNext(251, 4), onNext(261, 5), onNext(281, 6), onNext(291, 7), onNext(301, 8), onNext(311, 9), onCompleted(321)], $results->getMessages());
        $this->assertSubscriptions([subscribe(201, 241)], $xs1->getSubscriptions());
        $this->assertSubscriptions([subscribe(241, 271)], $xs2->getSubscriptions());
        $this->assertSubscriptions([subscribe(271, 321)], $xs3->getSubscriptions());
    }