- 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.
git-svn-id: https://svn.apache.org/repos/asf/incubator/zetacomponents/trunk@1062921 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/Template/src/configuration.php b/Template/src/configuration.php
index f826a07..a4a008c 100644
--- a/Template/src/configuration.php
+++ b/Template/src/configuration.php
@@ -311,6 +311,19 @@
}
/**
+ * 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.
diff --git a/Template/tests/template_test.php b/Template/tests/template_test.php
index f4a999e..f9b976b 100644
--- a/Template/tests/template_test.php
+++ b/Template/tests/template_test.php
@@ -58,13 +58,15 @@
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()