-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add setup guide for contributing and .env for testing
- Loading branch information
Showing
4 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Setup | ||
|
||
This document is meant for setting up this project locally for contributors, not | ||
for those seeking to use the package. For information on how to set up the | ||
project, refer to [the "Getting started" page](https://drtheuns.github.io/apitizer_php/index). | ||
|
||
## Steps | ||
|
||
1. Clone the repo | ||
|
||
``` | ||
git clone [email protected]:drtheuns/apitizer_php && cd apitizer_php | ||
``` | ||
|
||
2. Load dependencies | ||
|
||
``` | ||
composer install | ||
``` | ||
|
||
3. Setup testing | ||
|
||
Create a new file, `.env`, in the project root and put your database credentials | ||
in there: | ||
|
||
``` | ||
DB_CONNECTION=pgsql | ||
DB_DATABASE=apitizer_php_testing | ||
DB_USERNAME=postgres | ||
DB_PASSWORD=postgres | ||
``` | ||
|
||
You can now start testing by using the `composer test` alias, or by directly | ||
calling `./vendor/bin/phpunit`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
use Dotenv\Dotenv; | ||
|
||
require __DIR__.'/../vendor/autoload.php'; | ||
|
||
if (file_exists(__DIR__.'/../.env')) { | ||
$dotenv = Dotenv::create(__DIR__.'/../'); | ||
$dotenv->load(); | ||
} else { | ||
echo "You need to set up a .env file in order to begin testing\n"; | ||
echo "Refer to the SETUP.md for more information\n"; | ||
|
||
exit(1); | ||
} |