forked from laruence/yaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
033.phpt
62 lines (54 loc) · 1.66 KB
/
033.phpt
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
--TEST--
Check for Yaf_View_Simple with predefined template dir
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
"application" => array(
"directory" => realpath(dirname(__FILE__)),
"dispatcher" => array(
"catchException" => 0,
"throwException" => 1,
),
"modules" => "module",
),
);
class ControllerController extends Yaf_Controller_Abstract {
public function actionAction() {
}
public function indexAction() {
Yaf_Dispatcher::getInstance()->disableView();
$this->forward("dummy");
}
public function dummyAction() {
Yaf_Dispatcher::getInstance()->enableView();
}
}
$app = new Yaf_Application($config);
$request = new Yaf_Request_Http("/module/controller/action");
try {
$app->getDispatcher()->returnResponse(false)->dispatch($request);
} catch (Yaf_Exception $e) {
echo $e->getMessage(), "\n";
}
$view = new Yaf_View_Simple(dirname(__FILE__) . 'no-exists');
$app->getDispatcher()->setView($view);
try {
$app->getDispatcher()->returnResponse(false)->dispatch($request);
} catch (Yaf_Exception $e) {
echo $e->getMessage(), "\n";
}
$request = new Yaf_Request_Http("/module/controller/index");
try {
$app->getDispatcher()->returnResponse(false)->dispatch($request);
} catch (Yaf_Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Failed opening template %stests%cmodules%cModule%cviews%ccontroller%caction.phtml: No such file or directory
Failed opening template %stestsno-exists%ccontroller%caction.phtml: No such file or directory
Failed opening template %stestsno-exists%ccontroller%cdummy.phtml: No such file or directory