Base for a static organization website

test.php 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. set_time_limit(0);
  19. ini_set('display_errors', 1);
  20. /**
  21. * Use the DS to separate the directories in other defines
  22. */
  23. if (!defined('DS')) {
  24. define('DS', DIRECTORY_SEPARATOR);
  25. }
  26. /**
  27. * These defines should only be edited if you have CakePHP installed in
  28. * a directory layout other than the way it is distributed.
  29. * When using custom settings be sure to use the DS and do not add a trailing DS.
  30. */
  31. /**
  32. * The full path to the directory which holds "app", WITHOUT a trailing DS.
  33. */
  34. if (!defined('ROOT')) {
  35. define('ROOT', dirname(dirname(dirname(__FILE__))));
  36. }
  37. /**
  38. * The actual directory name for the "app".
  39. */
  40. if (!defined('APP_DIR')) {
  41. define('APP_DIR', basename(dirname(dirname(__FILE__))));
  42. }
  43. /**
  44. * The absolute path to the "Cake" directory, WITHOUT a trailing DS.
  45. *
  46. * For ease of development CakePHP uses PHP's include_path. If you
  47. * need to cannot modify your include_path, you can set this path.
  48. *
  49. * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
  50. *
  51. * The following line differs from its sibling
  52. * /lib/Cake/Console/Templates/skel/webroot/test.php
  53. */
  54. //define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
  55. /**
  56. * This auto-detects CakePHP as a composer installed library.
  57. * You may remove this if you are not planning to use composer (not recommended, though).
  58. */
  59. $vendorPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
  60. $dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
  61. if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispatcher)) {
  62. define('CAKE_CORE_INCLUDE_PATH', $vendorPath);
  63. }
  64. /**
  65. * Editing below this line should not be necessary.
  66. * Change at your own risk.
  67. */
  68. if (!defined('WEBROOT_DIR')) {
  69. define('WEBROOT_DIR', basename(dirname(__FILE__)));
  70. }
  71. if (!defined('WWW_ROOT')) {
  72. define('WWW_ROOT', dirname(__FILE__) . DS);
  73. }
  74. if (!defined('CAKE_CORE_INCLUDE_PATH')) {
  75. if (function_exists('ini_set')) {
  76. ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
  77. }
  78. if (!include 'Cake' . DS . 'bootstrap.php') {
  79. $failed = true;
  80. }
  81. } else {
  82. if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
  83. $failed = true;
  84. }
  85. }
  86. if (!empty($failed)) {
  87. 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);
  88. }
  89. if (Configure::read('debug') < 1) {
  90. throw new NotFoundException(__d('cake_dev', 'Debug setting does not allow access to this URL.'));
  91. }
  92. require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';
  93. CakeTestSuiteDispatcher::run();