incubator-zeta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [zeta-commits] svn commit: r1062921 - in /incubator/zetacomponents/trunk/Template: src/configuration.php tests/template_test.php
Date Mon, 24 Jan 2011 18:48:04 GMT
Author: toby
Date: Mon Jan 24 18:48:04 2011
New Revision: 1062921

URL: http://svn.apache.org/viewvc?rev=1062921&view=rev
Log:
- Fixed #ZETACOMP-41: Work around test dependencies through new method for
  explicitly setting a configuration in the ezcTemplateConfiguration registry.
# ezcTemplateConfiguration::setInstance() is marked private for now as
# discussed on the mailinglist.

Modified:
    incubator/zetacomponents/trunk/Template/src/configuration.php
    incubator/zetacomponents/trunk/Template/tests/template_test.php

Modified: incubator/zetacomponents/trunk/Template/src/configuration.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Template/src/configuration.php?rev=1062921&r1=1062920&r2=1062921&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Template/src/configuration.php (original)
+++ incubator/zetacomponents/trunk/Template/src/configuration.php Mon Jan 24 18:48:04 2011
@@ -311,6 +311,19 @@ class ezcTemplateConfiguration
     }
 
     /**
+     * Sets and replaces the unique configuration instance named $name.
+     * 
+     * @param ezcTemplateConfiguration $config 
+     * @param string $name 
+     * @return void
+     * @access private
+     */
+    public static function setInstance( ezcTemplateConfiguration $config, $name = "default"
)
+    {
+        self::$instanceList[$name] = $config;
+    }
+
+    /**
      * Adds custom tags or functions to the customBlock or customFunction
      * property and indirectly adds the custom extension to the template
      * language. 

Modified: incubator/zetacomponents/trunk/Template/tests/template_test.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Template/tests/template_test.php?rev=1062921&r1=1062920&r2=1062921&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Template/tests/template_test.php (original)
+++ incubator/zetacomponents/trunk/Template/tests/template_test.php Mon Jan 24 18:48:04 2011
@@ -58,13 +58,15 @@ class ezcTemplateTest extends ezcTestCas
         mkdir ( $this->templatePath );
         mkdir ( $this->compilePath );
 
-        $config = ezcTemplateConfiguration::getInstance();
+        $config = new ezcTemplateConfiguration();
         $config->templatePath = $this->templatePath;
         $config->compilePath = $this->compilePath;
+        ezcTemplateConfiguration::setInstance( $config );
 
-        $config2 = ezcTemplateConfiguration::getInstance("templates");
+        $config2 = new ezcTemplateConfiguration();
         $config2->templatePath = realpath( dirname( __FILE__ ) ) . '/' . 'templates';
         $config2->compilePath = $this->compilePath;
+        ezcTemplateConfiguration::setInstance( $config2, 'templates' );
     }
 
     protected function tearDown()



Mime
View raw message