From 4c24ec6e20cfe8f7a2edbea6582ab47fcf31c430 Mon Sep 17 00:00:00 2001 From: uwetews Date: Tue, 20 Oct 2015 01:21:37 +0200 Subject: [PATCH] split tests because of hhvm --- .../Extends/ExtendsResourceTest.php | 56 ++++++++++++++++--- .../BockExtend/CompileBlockExtendsTest.php | 26 ++++++++- 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php b/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php index 7eeb94d7..e74e5b80 100644 --- a/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php +++ b/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php @@ -103,8 +103,18 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; - $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); + } + + /** + * test grandchild/child/parent dependency test1 + * @runInSeparateProcess + * @preserveGlobalState disabled + */ + public function testCompileBlockGrandChildMustCompile_021_12() + { + $this->smarty->caching = true; + $this->smarty->cache_lifetime = 1000; + $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); $this->assertContains('Grandchild Page Title', $result); @@ -127,7 +137,17 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; + } + /** + * test grandchild/child/parent dependency test2 + * @runInSeparateProcess + * @preserveGlobalState disabled + * + */ + public function testCompileBlockGrandChildMustCompile_021_22() + { + $this->smarty->caching = true; + $this->smarty->cache_lifetime = 1000; $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); @@ -151,7 +171,17 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; + } + /** + * test grandchild/child/parent dependency test3 + * @runInSeparateProcess + * @preserveGlobalState disabled + * + */ + public function testCompileBlockGrandChildMustCompile_021_32() + { + $this->smarty->caching = true; + $this->smarty->cache_lifetime = 1000; $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); @@ -175,10 +205,20 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; - $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); - $this->assertTrue($tpl2->isCached()); - $result = $this->smarty->fetch($tpl2); + } + /** + * test grandchild/child/parent dependency test4 + * @runInSeparateProcess + * @preserveGlobalState disabled + * + */ + public function testCompileBlockGrandChildMustCompile_021_42() + { + $this->smarty->caching = true; + $this->smarty->cache_lifetime = 1000; + $tpl = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); + $this->assertFalse($tpl->isCached()); + $result = $this->smarty->fetch($tpl); $this->assertContains('Grandchild Page Title', $result); } diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php index b22b1578..c4dc296a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php @@ -529,7 +529,18 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; + } + /** + * test grandchild/child/parent dependency test3 + * @runInSeparateProcess + * @preserveGlobalState disabled + * + */ + public function testCompileBlockGrandChildMustCompile_021_32() + { + $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->caching = true; + $this->smarty->cache_lifetime = 1000; $tpl2 = $this->smarty->createTemplate('021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); @@ -553,7 +564,18 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); $this->assertContains('Grandchild Page Title', $result); - $this->smarty->_cache['template_objects'] = null; + } + + /** + * test grandchild/child/parent dependency test4 + * @runInSeparateProcess + * @preserveGlobalState disabled + */ + public function testCompileBlockGrandChildMustCompile_021_42() + { + $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->caching = true; + $this->smarty->cache_lifetime = 1000; $tpl2 = $this->smarty->createTemplate('021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2);