The following code exercises are available for the PHP track. You are encouraged to complete these as you progress through the coursework.
- Introductory Exercise
- Basic Exercises
- Object Oriented Exercises
To perform a code exercise, fork one of the repositories above. Follow the exercise README.md and make your code changes in the src/ directory.
When you are done, commit and push your changes to your fork and create a pull request. Upon doing so your solution will be automatically tested.
If your solution passes, the build will be marked successful and the pull request will be ready to merge.
If your solution fails, the build will be marked as failing and the pull request can no be merged. You should receive an email with more information about the failure. Make your changes. Once you commit them, the pull request will automatically be updated and the tests will rerun.
While it works, submitting a pull request to test your solution is time consuming and unnecssary. As such, you should run the tests locally before creating a pull request. This will also help familiarize you with the command line and using Composer.
To do so:
- Open a terminal
- Navigate to the project's root directory, e.g.
cd /workspace/dir/php-code-challenge - Install the project dependencies by running
composer install. Note: this only needs to be done once. - Run the tests with:
vendor/bin/phpunit