mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing issue where an app that was in a directory that had the same name
as a controller would end up failing to find view cache files. Adding test for app name in controller name failure to create cache Fixes #1025 Conflicts: cake/libs/view/helpers/cache.php
This commit is contained in:
parent
2a50c3a1fb
commit
2abf34d93e
1 changed files with 37 additions and 0 deletions
|
@ -451,6 +451,43 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$this->assertTrue(file_exists($filename));
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* test ControllerName contains AppName
|
||||
*
|
||||
* This test verifys view cache is created correctly when the app name is contained in part of the controller name.
|
||||
* (webapp Name) base name is 'cache' controller is 'cacheTest' action is 'cache_name'
|
||||
* apps url would look somehing like http://localhost/cache/cacheTest/cache_name
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function testCacheBaseNameControllerName() {
|
||||
$this->Controller->cache_parsing();
|
||||
$this->Controller->cacheAction = array(
|
||||
'cache_name' => 21600
|
||||
);
|
||||
$this->Controller->params = array(
|
||||
'controller' => 'cacheTest',
|
||||
'action' => 'cache_name',
|
||||
'url' => array(),
|
||||
'pass' => array(),
|
||||
'named' => array()
|
||||
);
|
||||
$this->Controller->here = '/cache/cacheTest/cache_name';
|
||||
$this->Controller->action = 'cache_name';
|
||||
$this->Controller->base = '/cache';
|
||||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNoPattern('/cake:nocache/', $result);
|
||||
$this->assertNoPattern('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cache_cachetest_cache_name.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* testCacheEmptySections method
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue