Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.36 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.36 KB

PHP Scaffold for Code Retreat

This scaffold comes with severals tools that work with docker under the hood.

  • php: a PHP 7.1 executable
  • phpspec: a PHP test framework
  • composer: a PHP dependencies manager

Run

./php-env [command]

to use a tool.

See scripts/ for build/test scripts wrapper in docker.

Install or update dependencies

The first time you use this scaffold you need to install all dependencies. This is done by using the PHP dependencies manager: composer. The following command should install all the dependencies in the /vendor directory.

./php-env composer install

Sometimes you need to update your dependencies or add a new one. As an example, we will add a second PHP unit test framework called: phpunit.

./php-env composer require phpunit/phpunit ^6.2

That's it! You can now use your favorite tools!

Run the tests

phpspec is a tool which can help you write clean and working PHP code using behaviour driven development. Run the following command to execute tests:

./php-env phpspec run

phpspec provides a tool to help you writing specification. You can use it with the desc subcommand:

./php-env phpspec desc [MyNewNamespace]/[MyNewClass]

Run the app

./php-env php app.php