pictcode / app / webroot / test.php @ 0b1b8047
履歴 | 表示 | アノテート | ダウンロード (3.384 KB)
1 |
<?php
|
---|---|
2 |
/**
|
3 |
* Web Access Frontend for TestSuite
|
4 |
*
|
5 |
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
|
6 |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
7 |
*
|
8 |
* Licensed under The MIT License
|
9 |
* For full copyright and license information, please see the LICENSE.txt
|
10 |
* Redistributions of files must retain the above copyright notice
|
11 |
*
|
12 |
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
13 |
* @link http://book.cakephp.org/2.0/en/development/testing.html
|
14 |
* @package app.webroot
|
15 |
* @since CakePHP(tm) v 1.2.0.4433
|
16 |
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
17 |
*/
|
18 |
|
19 |
set_time_limit(0); |
20 |
ini_set('display_errors', 1); |
21 |
|
22 |
/**
|
23 |
* Use the DS to separate the directories in other defines
|
24 |
*/
|
25 |
if (!defined('DS')) { |
26 |
define('DS', DIRECTORY_SEPARATOR); |
27 |
} |
28 |
|
29 |
/**
|
30 |
* These defines should only be edited if you have CakePHP installed in
|
31 |
* a directory layout other than the way it is distributed.
|
32 |
* When using custom settings be sure to use the DS and do not add a trailing DS.
|
33 |
*/
|
34 |
|
35 |
/**
|
36 |
* The full path to the directory which holds "app", WITHOUT a trailing DS.
|
37 |
*/
|
38 |
if (!defined('ROOT')) { |
39 |
define('ROOT', dirname(dirname(dirname(__FILE__)))); |
40 |
} |
41 |
|
42 |
/**
|
43 |
* The actual directory name for the "app".
|
44 |
*/
|
45 |
if (!defined('APP_DIR')) { |
46 |
define('APP_DIR', basename(dirname(dirname(__FILE__)))); |
47 |
} |
48 |
|
49 |
/**
|
50 |
* The absolute path to the "Cake" directory, WITHOUT a trailing DS.
|
51 |
*
|
52 |
* For ease of development CakePHP uses PHP's include_path. If you
|
53 |
* need to cannot modify your include_path, you can set this path.
|
54 |
*
|
55 |
* Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
|
56 |
*
|
57 |
* The following line differs from its sibling
|
58 |
* /lib/Cake/Console/Templates/skel/webroot/test.php
|
59 |
*/
|
60 |
//define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
|
61 |
|
62 |
/**
|
63 |
* This auto-detects CakePHP as a composer installed library.
|
64 |
* You may remove this if you are not planning to use composer (not recommended, though).
|
65 |
*/
|
66 |
$vendorPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib'; |
67 |
$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php'; |
68 |
if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispatcher)) { |
69 |
define('CAKE_CORE_INCLUDE_PATH', $vendorPath); |
70 |
} |
71 |
|
72 |
/**
|
73 |
* Editing below this line should not be necessary.
|
74 |
* Change at your own risk.
|
75 |
*/
|
76 |
if (!defined('WEBROOT_DIR')) { |
77 |
define('WEBROOT_DIR', basename(dirname(__FILE__))); |
78 |
} |
79 |
if (!defined('WWW_ROOT')) { |
80 |
define('WWW_ROOT', dirname(__FILE__) . DS); |
81 |
} |
82 |
|
83 |
if (!defined('CAKE_CORE_INCLUDE_PATH')) { |
84 |
if (function_exists('ini_set')) { |
85 |
ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); |
86 |
} |
87 |
if (!include 'Cake' . DS . 'bootstrap.php') { |
88 |
$failed = true; |
89 |
} |
90 |
} else {
|
91 |
if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') { |
92 |
$failed = true; |
93 |
} |
94 |
} |
95 |
if (!empty($failed)) { |
96 |
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/test.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR); |
97 |
} |
98 |
|
99 |
if (Configure::read('debug') < 1) { |
100 |
throw new NotFoundException(__d('cake_dev', 'Debug setting does not allow access to this URL.')); |
101 |
} |
102 |
|
103 |
require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php'; |
104 |
|
105 |
CakeTestSuiteDispatcher::run();
|