/** * @test */ public function race_throws_before_election() { $sourceNotDisposed = false; $error = new \Exception('error'); $o1 = $this->createHotObservable([onNext(150, 1), onError(210, $error)]); $o2 = $this->createHotObservable([onNext(150, 1), onNext(220, 3), onCompleted(250)])->doOnNext(function () use(&$sourceNotDisposed) { $sourceNotDisposed = true; }); $results = $this->scheduler->startWithCreate(function () use($o1, $o2) { return Observable::race([$o1, $o2]); }); $this->assertMessages([onError(210, $error)], $results->getMessages()); $this->assertFalse($sourceNotDisposed); }