PHP Testing Workshop
In 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 git@github.com: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 - PHPUnit
There 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 - Behat
There 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 Faur
https://github.com/afaur
Blaine Schmeisser
https://github.com/blainesch

PHP Testing Workshop

  • 1.
    PHP Testing Workshop Inthis workshop we will create a web application that will allow the end-user to store code examples online.
  • 2.
    Show them theapp! Show them the app!
  • 3.
    Clone the repositoryon 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
  • 4.
    Building Anon-O-Gist ● UsePHPUnit for Unit Testing. ● Use Behat for Behavior Testing. ● Create routes, controllers, views, and tests.
  • 6.
    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
  • 7.
    Unit Testing -PHPUnit There are broken tests, incomplete tests, and missing tests. Fix them if you can!
  • 9.
    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
  • 10.
    Integration Testing -Behat There are broken tests, incomplete tests, and missing tests. Get them done, if you can.
  • 12.
    New Features ● Don’tshow 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!)
  • 13.
    THE END … oris it? Adam Faur https://github.com/afaur Blaine Schmeisser https://github.com/blainesch