/**
* Creates an instance of this class
*
- * @return $iteratorInstance An instance of a Iterator class
+ * @return $iteratorInstance An instance of a Iterator class
*/
public final static function createTestUnitKeyProducerIterator () {
// Get new instance
* Getter for key from group or generic
*
* @return $key Current key in iteration
+ * @throws UnsupportedOperationException This method should not be called
*/
public function key () {
- // Default is null
- $key = null;
-
- $this->partialStub('Please implement this method.');
-
- // Return it
- return $key;
+ throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
}
/**
* Rewinds to the beginning of the iteration
*
* @return void
+ * @throws UnsupportedOperationException This method should not be called
*/
public function rewind () {
- $this->partialStub('Please implement this method.');
+ throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
}
/**
* Now we need to create an iterator, just as for the work units,
* to create new keys from the encrypted message. The iterator will
* not iterate over an object nor a collection. It will instead
- * encapsulate "key production" into a class and not in a simple
+ * encapsulate the "key production" into a class and not in a simple
* for() loop. These keys then needs to be bundled into test units
* and stored to database for later re-usage.
*/
// First get an iterator, again the helper will do that for us
$iteratorInstance = $this->getHelperInstance()->getKeyIterator();
- die(__METHOD__."\n");
+
+ // Begin the "key production"
+ while ($iteratorInstance->valid()) {
+ // Get current key (which is not the key of the iterator)
+ $currentKey = $iteratorInstance->current();
+
+ // @TODO Do something with it
+ $this->debugOutput('currentKey=' . $currentKey . ' needs to be processed.');
+
+ // Continue with next one
+ $iteratorInstance->next();
+ } // END - while
+
+ die(__METHOD__.": Ended the key production.\n");
}
}
}