Rx\Functional\Operator\ConcatMapTest::concatMapTo_Then_Error_Task PHP Method

concatMapTo_Then_Error_Task() public method

    public function concatMapTo_Then_Error_Task()
    {
        $xs = Observable::fromArray([4, 3, 2, 1]);
        $ys = Observable::error(new \Exception("test"));
        $results = [];
        $completed = false;
        $error = false;
        $xs->concatMapTo($ys)->subscribeCallback(function ($x) use(&$results) {
            $results[] = $x;
        }, function (\Exception $e) use(&$results, &$error) {
            $error = true;
            $this->assertSame("test", $e->getMessage());
        }, function () use(&$completed) {
            $completed = true;
        });
        $this->assertFalse($completed);
        $this->assertTrue($error);
    }