Example #1
0
 /**
  * Test the `top` method.
  */
 public function testTop()
 {
     /* @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);
     $stream = new TokenStream($list);
     $this->assertSame($token2, $stream->top());
 }