mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding a test case for CacheHelper correctly generating filenames when $this->here includes all the named and passed args. Refs #977
This commit is contained in:
parent
712ca6d5b5
commit
22673a5348
1 changed files with 36 additions and 0 deletions
|
@ -381,6 +381,42 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$this->assertFalse(file_exists($filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* test with named and pass args.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCacheWithNamedAndPassedArgs() {
|
||||
Router::reload();
|
||||
|
||||
$this->Controller->cache_parsing();
|
||||
$this->Controller->params = array(
|
||||
'controller' => 'cache_test',
|
||||
'action' => 'cache_parsing',
|
||||
'url' => array(),
|
||||
'pass' => array(1, 2),
|
||||
'named' => array(
|
||||
'name' => 'mark',
|
||||
'ice' => 'cream'
|
||||
)
|
||||
);
|
||||
$this->Controller->cacheAction = array(
|
||||
'cache_parsing' => 21600
|
||||
);
|
||||
$this->Controller->here = '/cache_test/cache_parsing/1/2/name:mark/ice:cream';
|
||||
$this->Controller->action = 'cache_parsing';
|
||||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNoPattern('/cake:nocache/', $result);
|
||||
$this->assertNoPattern('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cache_test_cache_parsing_1_2_name_mark_ice_cream.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that custom routes are respected when generating cache files.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue