// Get new instance
$producerInstance = new CruncherTestUnitProducer();
- // Test units have a 'test' source
- $sourceInstance = UnitSourceFactory::createUnitSourceInstance('test');
+ // Test units have a helper class that wraps the source
+ $helperInstance = ObjectFactory::createObjectByConfiguredName('crypto_random_message_helper_class', array('test'));
// So set it in the producer
- $producerInstance->setSourceInstance($sourceInstance);
+ $producerInstance->setHelperInstance($helperInstance);
// Return the prepared instance
return $producerInstance;
$this->debugInstance();
} else {
// Get an encrypted, random message from our source
- $encryptedMessage = $this->getSourceInstance()->generateMessageFromSource();
+ $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
die($encryptedMessage."\n");
}
}