/** * @test */ public function itemShouldPumpTheSameLookaheadOnlyOnce() { $item1 = new Item(new Rule(1, 'A', array('a', 'b', 'c')), 1); $item2 = $this->getMock('Dissect\\Parser\\LALR1\\Analysis\\Item', array('pump'), array(new Rule(1, 'A', array('a', 'b', 'c')), 2)); $item2->expects($this->once())->method('pump')->with($this->equalTo('d')); $item1->connect($item2); $item1->pump('d'); $item1->pump('d'); }