/** * Test the `count` method. */ public function testCount() { $list = new SplDoublyLinkedList(); $list->push($this->getMock('\\com\\mohiva\\common\\parser\\Token')); $list->push($this->getMock('\\com\\mohiva\\common\\parser\\Token')); $stream = new TokenStream($list); $this->assertSame(2, $stream->count()); }