Skip to content

Latest commit

 

History

History

soflophp

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SoFloPHP - Unit Testing

Slides, code examples, and reference materials for my SoFloPHP user group talk on Unit Testing in PHP.

Requirements

PHP 5.4+ and Composer

Instructions

Initial setup

$ git clone git@github.com:michaelmoussa/soflophp-unit-testing.git
$ cd ./soflophp-unit-testing
$ composer install --dev

Running tests

$ cd /path/to/soflophp-unit-testing/test
$ ../vendor/bin/phpunit .

Running tests with code coverage

$ cd /path/to/soflophp-unit-testing/test
$ ../vendor/bin/phpunit --coverage-html=./coverage-html .

After generating coverage, open the index.html file in your browser.

Jumping Around

Various presentation milestones have been tagged for easy reference. To list them, run:

$ git tag -l -n

Then git checkout <tag-name> to see the code relevant to that particular milestone.

Important Note: You should run composer install --dev after every checkout in case the tag you're looking at also included an update to composer.json.

Links