- Fork this repository and clone it to your machine
- Run the following to set up our Docker image for the first time:
docker compose build
- It contains PHP 7.2 (configurable via arg
PHP_VERSION
), Composer 2 and XDebug 3.
- It contains PHP 7.2 (configurable via arg
- Install composer dependencies:
docker compose run php composer install
- Try to conform to our code style
- You should make only one change in each branch
- Coverage % needs to be equal to or greater than that of the previous commit.
- When adding tests, keep the same namespace as source files.
- If you have added a file at
\MyParcelNL\Sdk\Model\MyNamespace
, with a method namedmyMethod
, you would create a test for this function in\MyParcelNL\Sdk\Test\Model\MyNamespace
and call the methodtestMyMethod
. If you're using a dataProvider it should be calledprovideTestMyMethodData
.
- If you have added a file at
If you haven't done so, prepare an .env
file:
cp .env.template .env
# .env
API_KEY_NL="<MyParcelNL API key>"
API_KEY_BE="<MyParcelBE API key>"
Run tests with the following command:
docker compose run php vendor/bin/phpunit
Create a local coverage report:
docker compose run php vendor/bin/phpunit --coverage-html coverage
Enable XDebug:
docker compose run php php -dxdebug.mode=debug vendor/bin/phpunit
Make as many commits as you'd like. We use Conventional Commits and semantic-release to simplify the process of releasing updates by automating release notes and changelogs based on the rules of @commitlint/config-conventional. Your branch will be squashed into one single valid commit.
- Keep your pull requests focused on single subjects
- Please explain what you changed and why
- We will review your code and thoroughly test it before squashing and merging your pull request