Permalink
Browse files

Added tests for bake shell cache prefix generation

  • Loading branch information...
1 parent 6ee3c1c commit c4caca85ef16cddc6c5b93689d4b2b83f122a1f1 @tigrang committed Jan 23, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
@@ -220,6 +220,24 @@ public function testSecurityCipherSeedGeneration() {
}
/**
+ * test generation of cache prefix
+ *
+ * @return void
+ */
+ public function testCachePrefixGeneration() {
+ $this->_setupTestProject();
+
+ $path = $this->Task->path . 'bake_test_app' . DS;
+ $result = $this->Task->cachePrefix($path);
+ $this->assertTrue($result);
+
+ $File = new File($path . 'Config' . DS . 'core.php');
+ $contents = $File->read();
+ $this->assertRegExp('/\$prefix = \'.+\';/', $contents, '$prefix is not defined');
+ $this->assertNotRegExp('/\$prefix = \'myapp_\';/', $contents, 'Default cache prefix left behind. %s');
+ }
+
+/**
* Test that index.php is generated correctly.
*
* @return void

0 comments on commit c4caca8

Please sign in to comment.