Top Banner
PHP Quality Assurance by Blaine Schmeisser
12

Php qa

Dec 06, 2014

Download

Documents

BlaineSch

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Php qa

PHP Quality Assuranceby Blaine Schmeisser

Page 2: Php qa

Meme

Page 3: Php qa

Who am I?

● My name is Blaine Schmeisser● Using PHP about 10 years● Zend PHP Certification● Created multiple OS PHP QA tools

○ Mostly for Lithium (#li3)■ li3_quality■ Mocking / Stubbing classes (aspect oriented)■ Tons of new assertion methods

[email protected]@BlaineSch

github.com/BlaineSchBlaineSch.com

[email protected]/BlaineSch

BlaineSch.com@BlaineSch

Page 4: Php qa

My code keeps breaking?

● Standard UT Framework● Lots of Assertions● Mocking / Stubbing● Easy to extend

○ Plugins○ Custom Assertions

● Lots of Plugins○ Jenkins

Page 5: Php qa

What about browser testing?

● User Stories○ Similar to Ruby's Cucumber

● Multiple Browsers○ Goutte○ Selenium○ WebDriver○ Sahi○ Zombie

Page 6: Php qa

How do I mock a file system?

● Pseudo-file system that lives in memory● No need to modify your code● No need to give your CI server extra file

permissions.

vfs:://Stream

Page 7: Php qa

How do I debug my code?

● Breakpoints● Walkthrough● Runtime changes● Dynamic Code Analysis

○ Code Coverage○ Code Complexity

● Plugins for Popular Editors○ Vim○ Sublime○ PHPStorm○ ...more

Page 8: Php qa

I can tell who wrote what code just by looking at it.

● Static Code Analysis● Per-project Standards● Define Custom Standards● Configure Existing Standards● Use with your CI Server (Jenkins/Travis)

○ Guarantee standards on pull requests

PHP CodeSniffer

Page 9: Php qa

Meme

Page 10: Php qa

What does this code do?

● Short/long descriptions● Examples of how to use it● Link to code/web● Param types, names, and descriptions● Return type and description● Gen in various formats

○ Searchable!● ...more!

Page 11: Php qa

I'm writing a ton of code.

● Use a framework○ Lithium (#li3)○ Zend Framework 2 (#zf2)○ Symfony 2○ WordPress

● Use Modules and Plugins○ Composer○ Packagist.org

Page 12: Php qa

Links!PHPUnit

https://github.com/sebastianbergmann/phpunit/vfsStream

https://github.com/mikey179/vfsStreamBehat

https://github.com/Behat/BehatPHP CodeSniffer

https://github.com/squizlabs/PHP_CodeSnifferXdebug

https://github.com/xdebug/xdebugLithium

https://github.com/UnionOfRADZend Framework 2

https://github.com/zendframework/zf2Symfony 2

https://github.com/symfony/symfonyComposer

https://github.com/composer/composer