Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

Fix paths, Specify migration group, Add Docs #6

Merged
merged 2 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

class CreateTestTables extends Migration
{
protected $DBGroup = 'tests';

public function up()
{
$fields = [
Expand Down
5 changes: 3 additions & 2 deletions src/tests/_support/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down