]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php
Continued on test-unit producer, fixed copyright:
[hub.git] / application / hub / main / producer / cruncher / work_units / class_CruncherTestUnitProducer.php
index 65ecef42f0ec669bbea640ee26fbd0c6d5037a5a..b9a255c41ffe6c6afd968ee455ea69426b8bc442 100644 (file)
@@ -41,29 +41,38 @@ class CruncherTestUnitProducer extends BaseProducer implements UnitProducer, Reg
                // Get new instance
                $producerInstance = new CruncherTestUnitProducer();
 
-               // Initialize this producer
-               $producerInstance->initProducer();
-
                // Return the prepared instance
                return $producerInstance;
        }
 
        /**
-        * Produces some work/test units and pushes them onto the queue
+        * Initializes the producer. This method satisfies the abstract BaseProducer
+        * class.
         *
         * @return      void
-        * @todo        0% done
         */
-       public function produceUnits () {
-               $this->partialStub('Please implement this method.');
+       protected function initProducer () {
+               // Get a XML template instance
+               $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('cruncher_test_unit_producer_template_class');
+
+               // Load the template
+               $templateInstance->loadCruncherTestUnitTemplate('test_unit');
+
+               // Render the XML content
+               $templateInstance->renderXmlContent();
+
+               // And set it in this cruncher
+               $this->setTemplateInstance($templateInstance);
        }
 
        /**
-        * Initializes the producer
+        * Produces some work/test units and pushes them onto the queue
         *
         * @return      void
+        * @todo        0% done
         */
-       private function initProducer () {
+       public function produceUnits () {
+               $this->partialStub('Please implement this method.');
        }
 }