annotate app/webroot/test.php @ 0:261e66bd5a0c

hg init
author Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
date Sun, 24 Jul 2011 21:08:31 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <?php
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 /**
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 * Web Access Frontend for TestSuite
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 * PHP versions 4 and 5
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 * Licensed under The Open Group Test Suite License
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 * Redistributions of files must retain the above copyright notice.
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 * @link http://book.cakephp.org/view/1196/Testing
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 * @package cake
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 * @subpackage cake.app.webroot
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 * @since CakePHP(tm) v 1.2.0.4433
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 */
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 set_time_limit(0);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 ini_set('display_errors', 1);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 /**
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 * Use the DS to separate the directories in other defines
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 */
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 if (!defined('DS')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 define('DS', DIRECTORY_SEPARATOR);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 /**
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 * These defines should only be edited if you have cake installed in
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 * a directory layout other than the way it is distributed.
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 * When using custom settings be sure to use the DS and do not add a trailing DS.
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 */
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 /**
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 * The full path to the directory which holds "app", WITHOUT a trailing DS.
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 */
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 if (!defined('ROOT')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 define('ROOT', dirname(dirname(dirname(__FILE__))));
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 /**
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 * The actual directory name for the "app".
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 */
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 if (!defined('APP_DIR')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 define('APP_DIR', basename(dirname(dirname(__FILE__))));
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 /**
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 */
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 if (!defined('CAKE_CORE_INCLUDE_PATH')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 define('CAKE_CORE_INCLUDE_PATH', ROOT);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 /**
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 * Editing below this line should not be necessary.
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 * Change at your own risk.
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 *
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 */
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 if (!defined('WEBROOT_DIR')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 define('WEBROOT_DIR', basename(dirname(__FILE__)));
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 if (!defined('WWW_ROOT')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 define('WWW_ROOT', dirname(__FILE__) . DS);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 if (!defined('CORE_PATH')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 define('APP_PATH', null);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 define('CORE_PATH', null);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 } else {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 define('APP_PATH', ROOT . DS . APP_DIR . DS);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 $corePath = App::core('cake');
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 if (isset($corePath[0])) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 } else {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 if (Configure::read('debug') < 1) {
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 die(__('Debug setting does not allow access to this url.', true));
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 }
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 $Dispatcher = new CakeTestSuiteDispatcher();
261e66bd5a0c hg init
Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 $Dispatcher->dispatch();