php testing workshop

13
PHP Testing Workshop In this workshop we will create a web application that will allow the end-user to store code examples online.

Upload: blainesch

Post on 03-Dec-2014

328 views

Category:

Software


3 download

DESCRIPTION

In this workshop we will create a web application that will allow the end-user to store code examples online.

TRANSCRIPT

Page 1: 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.

Page 2: PHP Testing Workshop

Show them the app!Show them the app!

Page 3: PHP Testing Workshop

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

Page 4: PHP Testing Workshop

Building Anon-O-Gist

● Use PHPUnit for Unit Testing.

● Use Behat for Behavior Testing.

● Create routes, controllers, views, and tests.

Page 5: PHP Testing Workshop
Page 6: PHP Testing Workshop

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

Page 7: PHP Testing Workshop

Unit Testing - PHPUnitThere are broken tests, incomplete tests, and missing tests. Fix them if you can!

Page 8: PHP Testing Workshop
Page 9: PHP Testing Workshop

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

Page 10: PHP Testing Workshop

Integration Testing - BehatThere are broken tests, incomplete tests, and missing tests. Get them done, if you can.

Page 11: PHP Testing Workshop
Page 12: PHP Testing Workshop

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!)

Page 13: PHP Testing Workshop

THE END… or is it?

Adam Faurhttps://github.com/afaur

Blaine Schmeisserhttps://github.com/blainesch