/** * Adds an element to the given collection and increases the size counter * * @param io.collection.IOCollection c * @param io.collection.IOElement e * @return io.collection.IOElement */ public function addElement(IOCollection $c, IOElement $e) { $c->addElement($e); $this->total++; with($key = $c->getURI()); isset($this->sizes[$key]) ? $this->sizes[$key]++ : ($this->sizes[$key] = 1); return $e; }
/** * Returns first element in a given collection * * @param io.IOCollection collection * @return io.IOElement * @throws unittest.AssertionFailedError if no elements are available */ protected function firstElement(IOCollection $collection) { $collection->open(); $first = $collection->next(); $collection->close(); $this->assertNotEquals(NULL, $first, 'No first element in ' . $collection->toString()); return $first; }
/** * Returns first element in a given collection * * @param io.IOCollection collection * @return io.IOElement * @throws unittest.AssertionFailedError if no elements are available */ protected function firstElement(IOCollection $collection) { $collection->open(); $first = $collection->next(); $collection->close(); $this->assertNotEquals(NULL, $first); return $first; }