- Fork the repository
- Create a new branch for each feature or improvement
- Send a pull request from each feature branch to the master branch
- Testing is done with phpunit.
./phpunit.xml
defines the path of where phpunit should look.- All tests must pass for a pull request to pass and is done automatically with Travis CI
- To run all tests locally: run
composer test
from root. - Run single test:
composer test tests/Functional/HomepageTest.php
- Git hooks should be used to prevent untested code to be pushed.
- Email tests can be done with mailtrap.io
- Migrate test database
scripts/phinx.sh migrate -e test -t 0
- Populate the database with default language
scripts/phinx.sh seed:run -s DefaultLanguage -e test
Error: Class 'path/to/class' not found
- Try running:
composer update
- Are the tests located under
./tests/
folder? - Is the wanted class to test using the correct namespace (
use MarketBoard\Tests\Unit;
)?
- Try running:
- To enable that all tests are executed and green before every push is done (
git push
). - run the script:
./scripts/install-hooks.sh
- This will create a symlink from your .git-directory to the ./scripts/pre-push.sh script.
- Reason for the symlink is to ease the maintenance of the script since the content of the .git-folder is not included in the repository.
- Under your .git/hooks there should after executed
ìnstall-hooks.sh
be a symlink like this:pre-push -> ../../scripts/pre-push.sh
- This will create a symlink from your .git-directory to the ./scripts/pre-push.sh script.
- "But, I really need to push my changes, a testcase is failing and its not my fault!"
- Cheating is not allowed, but having that said,
git push --no-verify
will ignore the git hook.
- Cheating is not allowed, but having that said,
All pull requests must adhere to the PSR-2 standard
- To search your files for styling errors, run
composer style -v --dry-run --diff
- To automatically fix styling errors, run
composer style
Using the file structure described in pds/skeleton should be applied to the extent possible.