[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaTemplateResolverTest: fix tests

git at icinga.org git at icinga.org
Mon Jan 2 12:21:32 CET 2017


Module: icingaweb2-module-director
Branch: master
Commit: 012b3023861963c33a66e3382acdafc35746b420
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=012b3023861963c33a66e3382acdafc35746b420

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Jan  2 12:20:19 2017 +0100

IcingaTemplateResolverTest: fix tests

---

 .../Objects/IcingaTemplateResolverTest.php         |   34 +++++++++-----------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/test/php/library/Director/Objects/IcingaTemplateResolverTest.php b/test/php/library/Director/Objects/IcingaTemplateResolverTest.php
index e4caedb..09d0ead 100644
--- a/test/php/library/Director/Objects/IcingaTemplateResolverTest.php
+++ b/test/php/library/Director/Objects/IcingaTemplateResolverTest.php
@@ -93,26 +93,27 @@ class IcingaTemplateResolverTest extends BaseTestCase
 
         // 5, 6, 5, 5, 4, 3, 5, 6, 2, 1
 
-        $prefix = $this->prefix;
-        $t1 = $this->create($prefix . 't1');
-        $t4 = $this->create($prefix . 't4');
-        $t3 = $this->create($prefix . 't3');
-        $t2 = $this->create($prefix . 't2');
-        $t5 = $this->create($prefix . 't5');
-        $t6 = $this->create($prefix . 't6');
-
-        $t1->set('imports', array($prefix . 't6', $prefix . 't5', $prefix . 't2'));
+        $t1 = $this->create('t1');
+        $t4 = $this->create('t4');
+        $t3 = $this->create('t3');
+        $t2 = $this->create('t2');
+        $t5 = $this->create('t5');
+        $t6 = $this->create('t6');
+
+        // TODO: Must work without this:
+        $t1->templateResolver()->clearCache();
+        $t1->set('imports', array($t6, $t5, $t2));
         $t6->set('imports', array($t5));
         $t3->set('imports', array($t4));
         $t2->set('imports', array($t3, $t6));
         $t4->set('imports', array($t5));
 
-        $t1->store();
-        $t2->store();
-        $t3->store();
-        $t4->store();
         $t5->store();
+        $t4->store();
+        $t3->store();
         $t6->store();
+        $t2->store();
+        $t1->store();
 
         // TODO: Must work without this:
         $t1->templateResolver()->clearCache();
@@ -134,7 +135,7 @@ class IcingaTemplateResolverTest extends BaseTestCase
     {
         $host = IcingaHost::create(
             array(
-                'object_name' => $name,
+                'object_name' => $this->prefixed($name),
                 'object_type' => 'template'
             )
         );
@@ -143,11 +144,6 @@ class IcingaTemplateResolverTest extends BaseTestCase
         return $host;
     }
 
-    protected function loadRendered($name)
-    {
-        return file_get_contents(__DIR__ . '/rendered/' . $name . '.out');
-    }
-
     public function tearDown()
     {
         $db = $this->getDb();



More information about the icinga-checkins mailing list