Permalink
Browse files

adding a test case for not-html caching

  • Loading branch information...
1 parent 8aeae05 commit 64ff25a83f1a45d7c1c6db68e6f327c6b5909bdf @AD7six AD7six committed Jan 21, 2011
Showing with 20 additions and 1 deletion.
  1. +20 −1 tests/cases/helpers/html_cache.test.php
@@ -39,10 +39,29 @@ public function testWriteCache() {
$this->View->output = $expected;
$this->View->_triggerHelpers('afterLayout');
-
+
$path = $this->www_root . 'cache' . DS . 'posts' . DS . 'index.html';
$this->assertTrue(file_exists($path));
$cached = file_get_contents($path);
$this->assertEqual($expected, $cached);
}
+
+ public function testWriteNotHtmlCache() {
+ $expected = <<<END
+<rss version="2.0">
+ <channel>
+ ...
+ </channel>
+</rss>
+END;
+ $this->View->loaded['HtmlCache']->here = '/posts.rss';
+ $this->View->params['url']['ext'] = 'rss';
+ $this->View->output = $expected;
+
+ $this->View->_triggerHelpers('afterLayout');
+ $path = $this->www_root . 'cache' . DS . 'posts.rss';
+ $this->assertTrue(file_exists($path));
+ $cached = file_get_contents($path);
+ $this->assertEqual($expected, $cached);
+ }
}

0 comments on commit 64ff25a

Please sign in to comment.