/** * @return Iterator\Bottle */ public function currentItem() { if (!$this->isDone()) { return $this->bottleCrate->getBottle($this->index); } throw new \OutOfBoundsException("No more bottle in the crate."); }
/** * Checks if current position is valid * @return bool */ public function valid() { return null !== $this->bottleCrate->getBottle($this->index); }
public function testGetBottle() { $this->assertEquals('Château Rayas - Wine', $this->bottleCrate->getBottle(1)); }