/** * @expectedException Exception */ public function test_get_tail_or_head_of_empty_stream_throws_exception() { $s = new Stream(10, function () { return new Stream(); }); $this->assertTrue($s->tail()->tail()); $this->assertTrue($s->tail()->head()); }