PHP Testing Workshop
description
Transcript of PHP Testing Workshop
PHP Testing WorkshopIn this workshop we will create a web application that will allow the end-user to store code examples online.
Show them the app!Show them the app!
Clone the repository on Github● git clone [email protected]:blainesch/anon-o-
gist.git
● Install mcrypt via readme.md instructions.
● cd anon-o-gist● php composer.phar install
● cd public● php -S localhost:3001
Building Anon-O-Gist
● Use PHPUnit for Unit Testing.
● Use Behat for Behavior Testing.
● Create routes, controllers, views, and tests.
Unit Testing - PHPUnit● Designed to test Units of code● File names in a `ClassNameTest.php`● Method names in `testMethodName`● Lots of assertions: assertEquals,
assertCount, assertEmpty● Show them the directory!
http://phpunit.de/getting-started.html
Unit Testing - PHPUnitThere are broken tests, incomplete tests, and missing tests. Fix them if you can!
Integration Testing - Behat● Designed to test Behaviors of code in
human readable stories● File names are in a `behavior.feature`
format● Tests are `scenarios`● Show them the directory!
http://docs.behat.org/quick_intro.html
Integration Testing - BehatThere are broken tests, incomplete tests, and missing tests. Get them done, if you can.
New Features● Don’t show gists that have been flagged 5 or more times.● Add ability to delete gists with a password.● Have permalinks (`/gists/MjMyMw==`) vs ids (`/gists/2323`)● Add to travis. (continual integration!)
THE END… or is it?
Adam Faurhttps://github.com/afaur
Blaine Schmeisserhttps://github.com/blainesch