/** * @test */ public function combineLatest_never_throw() { $error = new \Exception(); $e1 = new NeverObservable(); $e2 = $this->createHotObservable([onNext(150, 1), onError(220, $error)]); $results = $this->scheduler->startWithCreate(function () use($e1, $e2) { return $e1->combineLatest([$e2], [$this, 'add']); }); $this->assertMessages([onError(220, $error)], $results->getMessages()); }
/** * @test */ public function publishLast_multiple_connections() { $xs = new NeverObservable(); $ys = $xs->publishLast(); $connection1 = $ys->connect(); $connection2 = $ys->connect(); $this->assertTrue($connection1 === $connection2); $connection1->dispose(); $connection2->dispose(); $connection3 = $ys->connect(); $this->assertTrue($connection1 !== $connection3); }
/** * @test */ public function replay_time_multiple_connections() { $xs = new NeverObservable(); $ys = $xs->replay(null, null, 100); $connection1 = $ys->connect(); $connection2 = $ys->connect(); $this->assertTrue($connection1 === $connection2); $connection1->dispose(); $connection2->dispose(); $connection3 = $ys->connect(); $this->assertTrue($connection1 !== $connection3); }