From 0441c9f6c3899d7a4bc034038de41cf7cf0e99b2 Mon Sep 17 00:00:00 2001 From: Tigran Gabrielyan Date: Sun, 22 Jan 2012 17:23:42 -0800 Subject: [PATCH] Added tests for bake shell cache prefix generation --- .../Console/Command/Task/ProjectTaskTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php index 8fd1b33f0..b9fbe469b 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php @@ -249,6 +249,24 @@ class ProjectTaskTest extends CakeTestCase { $this->assertNotRegExp('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s'); } +/** + * 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. *