/** * Test the `unshift` method. */ public function testUnshift() { /* @var \com\mohiva\common\parser\Token $token1 */ /* @var \com\mohiva\common\parser\Token $token2 */ $token1 = $this->getMock('\\com\\mohiva\\common\\parser\\Token'); $token2 = $this->getMock('\\com\\mohiva\\common\\parser\\Token'); $list = new SplDoublyLinkedList(); $list->push($token1); $stream = new TokenStream($list); $stream->unshift($token2); $this->assertSame($token2, $list->bottom()); }