public function testForward() { $history = new History(); $history->add(new Request('http://www.example.com/', 'get')); $history->add(new Request('http://www.example1.com/', 'get')); try { $history->forward(); $this->fail('->forward() throws a \\LogicException if the history is already on the last page'); } catch (\Exception $e) { $this->assertInstanceof('LogicException', $e, '->forward() throws a \\LogicException if the history is already on the last page'); } $history->back(); $history->forward(); $this->assertSame('http://www.example1.com/', $history->current()->getUri(), '->forward() returns the next request in the history'); }
/** * @return WordPress */ private function make_instance() { return new WordPress($this->server, $this->history->reveal(), $this->cookieJar->reveal(), $this->uriToIndexMapper->reveal()); }