Skip to content

Commit

Permalink
Added tests for bake shell cache prefix generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrang authored and markstory committed Aug 25, 2012
1 parent 8e818c8 commit 0441c9f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
Expand Up @@ -249,6 +249,24 @@ public function testSecurityCipherSeedGeneration() {
$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.
*
Expand Down

0 comments on commit 0441c9f

Please sign in to comment.