Exemplo n.º 1
0
 /**
  * Test the `prev` method.
  */
 public function testPrev()
 {
     /* @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);
     $list->push($token2);
     $list->rewind();
     $stream = new TokenStream($list);
     $stream->next();
     $stream->prev();
     $this->assertSame($token1, $list->current());
 }