Skip to content

Unit and Integration Testing (Draft)

Ryan Parman edited this page Jan 28, 2018 · 1 revision

Firstly, download and install the dependencies.

composer install -oa

Unit Tests

You can run the unit tests as follows:

bin/phpunit --testsuite unit

When we write unit tests, we are testing that the single piece of code (i.e., function, method) does what it is supposed to be doing. A test should be very small and very focused. We will write lots and lots of these, and we will writes mocks to simulate Factory classes.

Integration Test Schema

You can run the integration tests as follows:

bin/phpunit --testsuite integration

When we write integration tests, we are testing that two pieces of code (e.g., classes) are working together to accomplish what they are supposed to be doing. An integration test may be larger than a unit test. We will write fewer of these, and will back them with known-good data.

All at Once

You can run both unit and integration tests at the same time with:

make test
Clone this wiki locally