Browse Source

Adding compile eviction test

Jose Lorenzo Rodriguez 11 years ago
parent
commit
2118906b6d
1 changed files with 15 additions and 0 deletions
  1. 15 0
      tests/TestCase/View/StringTemplateTest.php

+ 15 - 0
tests/TestCase/View/StringTemplateTest.php

@@ -194,4 +194,19 @@ class StringTemplateTest extends TestCase {
 		);
 	}
 
+/**
+ * Tests that compile information is refreshed on adds and removes
+ *
+ * @return void
+ */
+	public function testCopiledInfoRefresh() {
+		$compilation = $this->template->compile('link');
+		$this->template->add([
+			'link' => '<a bar="{{foo}}">{{baz}}</a>'
+		]);
+		$this->assertNotEquals($compilation, $this->template->compile('link'));
+		$this->template->remove('link');
+		$this->assertEquals([null, null], $this->template->compile('link'));
+	}
+
 }