1--TEST--
2Check for Yaf_View_Simple with predefined template dir
3--SKIPIF--
4<?php if (!extension_loaded("yaf")) print "skip"; ?>
5--INI--
6yaf.use_namespace=0
7--FILE--
8<?php
9$config = array(
10	"application" => array(
11		"directory" => realpath(dirname(__FILE__)),
12		"dispatcher" => array(
13			"catchException" => 0,
14			"throwException" => 1,
15		),
16        "modules" => "module",
17	),
18);
19
20class ControllerController extends Yaf_Controller_Abstract {
21    public function actionAction() {
22    }
23
24    public function indexAction() {
25        Yaf_Dispatcher::getInstance()->disableView();
26        $this->forward("dummy");
27    }
28
29    public function dummyAction() {
30        Yaf_Dispatcher::getInstance()->enableView();
31    }
32}
33
34
35$app = new Yaf_Application($config);
36$request = new Yaf_Request_Http("/module/controller/action");
37
38try {
39  $app->getDispatcher()->returnResponse(false)->dispatch($request);
40} catch (Yaf_Exception $e) {
41  echo $e->getMessage(), "\n";
42}
43
44$view = new Yaf_View_Simple(dirname(__FILE__) . 'no-exists');
45$app->getDispatcher()->setView($view);
46try {
47  $app->getDispatcher()->returnResponse(false)->dispatch($request);
48} catch (Yaf_Exception $e) {
49  echo $e->getMessage(), "\n";
50}
51
52$request = new Yaf_Request_Http("/module/controller/index");
53try {
54  $app->getDispatcher()->returnResponse(false)->dispatch($request);
55} catch (Yaf_Exception $e) {
56  echo $e->getMessage(), "\n";
57}
58?>
59--EXPECTF--
60Failed opening template %stests%cmodules%cModule%cviews%ccontroller%caction.phtml: No such file or directory
61Failed opening template %stestsno-exists%ccontroller%caction.phtml: No such file or directory
62Failed opening template %stestsno-exists%ccontroller%cdummy.phtml: No such file or directory
63