From 9e14085148ebd029ff2fe337d807ebca6b21798c Mon Sep 17 00:00:00 2001 From: Matt Gatner Date: Sat, 30 Nov 2019 01:16:34 +0000 Subject: [PATCH 1/2] Specify database group on test migration --- .../Migrations/2019-09-02-092335_create_test_tables.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/_support/Database/Migrations/2019-09-02-092335_create_test_tables.php b/src/tests/_support/Database/Migrations/2019-09-02-092335_create_test_tables.php index e63da6f..1b94289 100644 --- a/src/tests/_support/Database/Migrations/2019-09-02-092335_create_test_tables.php +++ b/src/tests/_support/Database/Migrations/2019-09-02-092335_create_test_tables.php @@ -4,6 +4,8 @@ class CreateTestTables extends Migration { + protected $DBGroup = 'tests'; + public function up() { $fields = [ From 9533ad88ae54cc9aecda699f89d8c45b39853147 Mon Sep 17 00:00:00 2001 From: Matt Gatner Date: Sat, 30 Nov 2019 01:21:07 +0000 Subject: [PATCH 2/2] Bugfix SUPPORTPATH, add docs on paths --- README.md | 17 +++++++++++++++++ src/tests/_support/bootstrap.php | 5 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 120209b..5922e9e 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,23 @@ composer.lock Examples of **composer.json** and **.gitignore** are located in the [examples/](examples/) folder if you need a starting point. +### Paths + +A number of framework and testing path are defined as constants during the +[bootstrap process](src/tests/_support/bootstrap.php). These default to the assumed locations +if you have a standard directory structure. If you move directories around you will need to +review these paths and set them appropriately. + +* **APPPATH**: `$paths->appDirectory` +* **ROOTPATH**: `APPPATH . '../'` +* **FCPATH**: `ROOTPATH . 'public/'` +* **WRITEPATH**: `$paths->writableDirectory` +* **SYSTEMPATH**: `$paths->systemDirectory` +* **CIPATH**: `SYSTEMPATH . '../` +* **SUPPORTPATH**: `CIPATH . 'tests/_support/` +* **PROJECTSUPPORTPATH**: *bootstrap.php directory* +* **TESTPATH**: `PROJECTSUPPORTPATH . '../` + ## Updating As this repo is updated with bugfixes and improvements you will want to update your diff --git a/src/tests/_support/bootstrap.php b/src/tests/_support/bootstrap.php index 0d0a5a6..0ab2f7d 100644 --- a/src/tests/_support/bootstrap.php +++ b/src/tests/_support/bootstrap.php @@ -17,9 +17,10 @@ define('APPPATH', realpath($paths->appDirectory) . DIRECTORY_SEPARATOR); define('ROOTPATH', realpath(APPPATH . '../') . DIRECTORY_SEPARATOR); define('FCPATH', realpath(ROOTPATH . 'public') . DIRECTORY_SEPARATOR); -define('SYSTEMPATH', realpath($paths->systemDirectory) . DIRECTORY_SEPARATOR); define('WRITEPATH', realpath($paths->writableDirectory) . DIRECTORY_SEPARATOR); -define('SUPPORTPATH', realpath(ROOTPATH . 'tests/_support') . DIRECTORY_SEPARATOR); +define('SYSTEMPATH', realpath($paths->systemDirectory) . DIRECTORY_SEPARATOR); +define('CIPATH', realpath(SYSTEMPATH . '../') . DIRECTORY_SEPARATOR); +define('SUPPORTPATH', realpath(CIPATH . 'tests/_support') . DIRECTORY_SEPARATOR); // Define necessary module test path constants define('MODULESUPPORTPATH', realpath(__DIR__) . DIRECTORY_SEPARATOR);