]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/template/producer/test_units/class_XmlCruncherTestUnitTemplateEngine.php
Test units continued, XML MIME type worked-around:
[hub.git] / application / hub / main / template / producer / test_units / class_XmlCruncherTestUnitTemplateEngine.php
index 8dc4160f8d29a8f74851d0587526ac2123f30888..3fadf06bc9d01d648057bba4c478bfbc179b0f33 100644 (file)
@@ -34,6 +34,16 @@ class XmlCruncherTestUnitTemplateEngine extends BaseTemplateEngine implements Co
         * Sub nodes in the XML tree
         */
        private $subNodes = array(
+               'meta-data',
+               'global-project-identifier',
+               'cipher',
+               'cipher-function',
+               'cipher-name',
+               'unprocessed-data',
+               'cruncher-key-list',
+               'cruncher-key',
+               'key-id',
+               'key-value'
        );
 
        /**
@@ -228,7 +238,6 @@ class XmlCruncherTestUnitTemplateEngine extends BaseTemplateEngine implements Co
         * @param       $resource               XML parser resource (currently ignored)
         * @param       $characters             Characters to handle
         * @return      void
-        * @todo        Find something useful with this!
         */
        public function characterHandler ($resource, $characters) {
                // Trim all spaces away
@@ -240,10 +249,9 @@ class XmlCruncherTestUnitTemplateEngine extends BaseTemplateEngine implements Co
                        return false;
                } // END - if
 
-               // Get current XML node name as an array index
-               $nodeName = $this->getStackerInstance()->getNamed('cruncher_test_unit');
-
-               $this->partialStub('TODO: Do something with the gathered data.');
+               // Assign the found characters to variable and use the last entry from
+               // stack as the name
+               parent::assignVariable($this->getStackerInstance()->getNamed('cruncher_test_unit'), $characters);
        }
 
        /**
@@ -265,6 +273,208 @@ class XmlCruncherTestUnitTemplateEngine extends BaseTemplateEngine implements Co
                $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'cruncher-test-unit');
        }
 
+       /**
+        * Starts the meta-data
+        *
+        * @return      void
+        */
+       private function startMetaData () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'meta-data');
+       }
+
+       /**
+        * Starts the global-project-identifier
+        *
+        * @return      void
+        */
+       private function startGlobalProjectIdentifier () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'global-project-identifier');
+       }
+
+       /**
+        * Finishes the global-project-identifier
+        *
+        * @return      void
+        */
+       private function finishGlobalProjectIdentifier () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Starts the cipher
+        *
+        * @return      void
+        */
+       private function startCipher () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'cipher');
+       }
+
+       /**
+        * Starts the cipher-function
+        *
+        * @return      void
+        */
+       private function startCipherFunction () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'cipher-function');
+       }
+
+       /**
+        * Finishes the cipher-function
+        *
+        * @return      void
+        */
+       private function finishCipherFunction () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Starts the cipher-name
+        *
+        * @return      void
+        */
+       private function startCipherName () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'cipher-name');
+       }
+
+       /**
+        * Finishes the cipher-name
+        *
+        * @return      void
+        */
+       private function finishCipherName () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Finishes the cipher
+        *
+        * @return      void
+        */
+       private function finishCipher () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Finishes the meta-data
+        *
+        * @return      void
+        */
+       private function finishMetaData () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Starts the unprocessed-data
+        *
+        * @return      void
+        */
+       private function startUnprocessedData () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'unprocessed-data');
+       }
+
+       /**
+        * Starts the cruncher-key-list
+        *
+        * @param       $keyCount       Count of keys in this test unit
+        * @return      void
+        * @todo        Handle $keyCount
+        */
+       private function startCruncherKeyList ($keyCount) {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'cruncher-key-list');
+       }
+
+       /**
+        * Starts the cruncher-key
+        *
+        * @return      void
+        */
+       private function startCruncherKey () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'cruncher-key');
+       }
+
+       /**
+        * Starts the key-id
+        *
+        * @return      void
+        */
+       private function startKeyId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'key-id');
+       }
+
+       /**
+        * Finishes the key-id
+        *
+        * @return      void
+        */
+       private function finishKeyId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Starts the key-value
+        *
+        * @return      void
+        */
+       private function startKeyValue () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('cruncher_test_unit', 'key-value');
+       }
+
+       /**
+        * Finishes the key-value
+        *
+        * @return      void
+        */
+       private function finishKeyValue () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Finishes the cruncher-key
+        *
+        * @return      void
+        */
+       private function finishCruncherKey () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Finishes the cruncher-key-list
+        *
+        * @return      void
+        */
+       private function finishCruncherKeyList () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
+       /**
+        * Finishes the unprocessed-data
+        *
+        * @return      void
+        */
+       private function finishUnprocessedData () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('cruncher_test_unit');
+       }
+
        /**
         * Finishes the test-unit
         *