public function itemAt($index) { if (is_integer($index)) { return parent::itemAt($index); } else { return $this->findCookieByName($index); } }
public function testItemAt() { $coll = new THttpCookieCollection(); $coll->insertAt(0, new THttpCookie('name', 'value')); self::assertEquals('value', $coll->itemAt(0)->getValue()); self::assertEquals('value', $coll->itemAt('name')->getValue()); }