/
TestCachedPagesController.php
97 lines (84 loc) · 1.35 KB
/
TestCachedPagesController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
namespace TestApp\Controller;
use Cake\Controller\Controller;
/**
* TestCachedPagesController class
*
*/
class TestCachedPagesController extends Controller {
/**
* uses property
*
* @var array
*/
public $uses = array();
/**
* helpers property
*
* @var array
*/
public $helpers = array('Cache', 'Html');
/**
* cacheAction property
*
* @var array
*/
public $cacheAction = array(
'index' => '+2 sec',
'test_nocache_tags' => '+2 sec',
'view' => '+2 sec'
);
/**
* Mock out the response object so it doesn't send headers.
*
* @var string
*/
protected $_responseClass = 'Cake\Test\TestCase\Routing\DispatcherMockResponse';
/**
* viewPath property
*
* @var string
*/
public $viewPath = 'Posts';
/**
* index method
*
* @return void
*/
public function index() {
$this->render();
}
/**
* test_nocache_tags method
*
* @return void
*/
public function test_nocache_tags() {
$this->render();
}
/**
* view method
*
* @param $id
* @return void
*/
public function view($id = null) {
$this->render('index');
}
/**
* test cached forms / tests view object being registered
*
* @return void
*/
public function cache_form() {
$this->cacheAction = 10;
$this->helpers[] = 'Form';
}
/**
* Test cached views with themes.
*/
public function themed() {
$this->cacheAction = 10;
$this->theme = 'TestTheme';
}
}