我在cakePHP 2.6项目中使用主题,并希望测试我的应用程序。
我在/app/View/Pages/view.ctp
中有一个视图文件
我在这里覆盖/app/View/Themed/Theme/Pages/view.ctp
如何更改$this->theme
以获取主题视图的结果?
我尝试了这个(没有结果):
public function testView() {
$this->theme = 'Theme';
$url = Router::url(array('controller' => 'Pages', 'action' => 'view'));
$options = array(
'return' => 'contents'
);
$result = $this->testAction($url, $options);
$this->assertNotEmpty($result);
}