Skip to content

Commit

Permalink
Fixes codeigniter4#2676 add ability to test redirect()->route() via C…
Browse files Browse the repository at this point in the history
…ontrollerTester
  • Loading branch information
samsonasik committed Mar 11, 2020
1 parent 96aead7 commit 4eb78e3
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions system/Test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
$paths = new Config\Paths();

// Define necessary framework path constants
defined('APPPATH') || define('APPPATH', realpath($paths->appDirectory) . DIRECTORY_SEPARATOR);
defined('WRITEPATH') || define('WRITEPATH', realpath($paths->writableDirectory) . DIRECTORY_SEPARATOR);
defined('SYSTEMPATH') || define('SYSTEMPATH', realpath($paths->systemDirectory) . DIRECTORY_SEPARATOR);
defined('ROOTPATH') || define('ROOTPATH', realpath(APPPATH . '../') . DIRECTORY_SEPARATOR);
defined('CIPATH') || define('CIPATH', realpath(SYSTEMPATH . '../') . DIRECTORY_SEPARATOR);
defined('FCPATH') || define('FCPATH', realpath(PUBLICPATH) . DIRECTORY_SEPARATOR);
defined('TESTPATH') || define('TESTPATH', realpath(HOMEPATH . 'tests/') . DIRECTORY_SEPARATOR);
defined('SUPPORTPATH') || define('SUPPORTPATH', realpath(TESTPATH . '_support/') . DIRECTORY_SEPARATOR);
defined('APPPATH') || define('APPPATH', realpath($paths->appDirectory) . DIRECTORY_SEPARATOR);
defined('WRITEPATH') || define('WRITEPATH', realpath($paths->writableDirectory) . DIRECTORY_SEPARATOR);
defined('SYSTEMPATH') || define('SYSTEMPATH', realpath($paths->systemDirectory) . DIRECTORY_SEPARATOR);
defined('ROOTPATH') || define('ROOTPATH', realpath(APPPATH . '../') . DIRECTORY_SEPARATOR);
defined('CIPATH') || define('CIPATH', realpath(SYSTEMPATH . '../') . DIRECTORY_SEPARATOR);
defined('FCPATH') || define('FCPATH', realpath(PUBLICPATH) . DIRECTORY_SEPARATOR);
defined('TESTPATH') || define('TESTPATH', realpath(HOMEPATH . 'tests/') . DIRECTORY_SEPARATOR);
defined('SUPPORTPATH') || define('SUPPORTPATH', realpath(TESTPATH . '_support/') . DIRECTORY_SEPARATOR);
defined('COMPOSER_PATH') || define('COMPOSER_PATH', realpath(HOMEPATH . 'vendor/autoload.php'));

// Load Common.php from App then System
Expand Down Expand Up @@ -58,3 +58,11 @@ class_alias('Config\Services', 'CodeIgniter\Services');

// Register the loader with the SPL autoloader stack.
$loader->register();

helper('url');

$appConfig = config(\Config\App::class);
$app = new \CodeIgniter\CodeIgniter($appConfig);
$app->initialize();

$app->run();

0 comments on commit 4eb78e3

Please sign in to comment.