SlideShare a Scribd company logo
1 of 12
Download to read offline
PHP Quality
Assurance
by Blaine Schmeisser
Meme
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
BlaineSch@gmail.com
@BlaineSch
github.com/BlaineSch
BlaineSch.com
BlaineSch@gmail.com
github.com/BlaineSch
BlaineSch.com
@BlaineSch
My code keeps breaking?
● Standard UT Framework
● Lots of Assertions
● Mocking / Stubbing
● Easy to extend
○ Plugins
○ Custom Assertions
● Lots of Plugins
○ Jenkins
What about browser testing?
● User Stories
○ Similar to Ruby's Cucumber
● Multiple Browsers
○ Goutte
○ Selenium
○ WebDriver
○ Sahi
○ Zombie
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
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
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
Meme
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!
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
Links!
PHPUnit
https://github.com/sebastianbergmann/phpunit/
vfsStream
https://github.com/mikey179/vfsStream
Behat
https://github.com/Behat/Behat
PHP CodeSniffer
https://github.com/squizlabs/PHP_CodeSniffer
Xdebug
https://github.com/xdebug/xdebug
Lithium
https://github.com/UnionOfRAD
Zend Framework 2
https://github.com/zendframework/zf2
Symfony 2
https://github.com/symfony/symfony
Composer
https://github.com/composer/composer

More Related Content

Viewers also liked (6)

PHP Testing Workshop
PHP Testing WorkshopPHP Testing Workshop
PHP Testing Workshop
 
24 pull requests
24 pull requests24 pull requests
24 pull requests
 
My toolkit
My toolkitMy toolkit
My toolkit
 
Version open source everything
Version   open source everythingVersion   open source everything
Version open source everything
 
Introducing Electron
Introducing ElectronIntroducing Electron
Introducing Electron
 
Pryjs
PryjsPryjs
Pryjs
 

Similar to Php qa

Developing word press professionally
Developing word press professionallyDeveloping word press professionally
Developing word press professionallyAustin Gil
 
Aws Developer Associate Overview
Aws Developer Associate OverviewAws Developer Associate Overview
Aws Developer Associate OverviewAbhi Jain
 
Pentester++
Pentester++Pentester++
Pentester++CTruncer
 
How to become a Zend Certified PHP Engineer
How to become a Zend Certified PHP EngineerHow to become a Zend Certified PHP Engineer
How to become a Zend Certified PHP EngineerTuyen Vuong
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional ProgrammerDave Cross
 
Development Guide for Beginners
Development Guide for BeginnersDevelopment Guide for Beginners
Development Guide for BeginnersYevhen Shyshkin
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)rc2209
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)Igalia
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsNetsparker
 
Chrome extensions
Chrome extensions Chrome extensions
Chrome extensions Ahmad Tahhan
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testingEngineor
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Aaron Saray
 
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress CodingWordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress CodingAaron Saray
 
Experience protocol buffer on android
Experience protocol buffer on androidExperience protocol buffer on android
Experience protocol buffer on androidRichard Chang
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPPaul Redmond
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHPRogério Vicente
 

Similar to Php qa (20)

Developing word press professionally
Developing word press professionallyDeveloping word press professionally
Developing word press professionally
 
Ruxmon.2015-08.-.proxenet
Ruxmon.2015-08.-.proxenetRuxmon.2015-08.-.proxenet
Ruxmon.2015-08.-.proxenet
 
Aws Developer Associate Overview
Aws Developer Associate OverviewAws Developer Associate Overview
Aws Developer Associate Overview
 
Pentester++
Pentester++Pentester++
Pentester++
 
How to become a Zend Certified PHP Engineer
How to become a Zend Certified PHP EngineerHow to become a Zend Certified PHP Engineer
How to become a Zend Certified PHP Engineer
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Development Guide for Beginners
Development Guide for BeginnersDevelopment Guide for Beginners
Development Guide for Beginners
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)
 
WordPress 101
WordPress 101WordPress 101
WordPress 101
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass Firewalls
 
Chrome extensions
Chrome extensions Chrome extensions
Chrome extensions
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012
 
Brad wood -_whats_a_pull_request
Brad wood -_whats_a_pull_requestBrad wood -_whats_a_pull_request
Brad wood -_whats_a_pull_request
 
Brad wood -_whats_a_pull_request
Brad wood -_whats_a_pull_requestBrad wood -_whats_a_pull_request
Brad wood -_whats_a_pull_request
 
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress CodingWordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
 
Experience protocol buffer on android
Experience protocol buffer on androidExperience protocol buffer on android
Experience protocol buffer on android
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
 

Php qa

  • 3. 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 BlaineSch@gmail.com @BlaineSch github.com/BlaineSch BlaineSch.com BlaineSch@gmail.com github.com/BlaineSch BlaineSch.com @BlaineSch
  • 4. My code keeps breaking? ● Standard UT Framework ● Lots of Assertions ● Mocking / Stubbing ● Easy to extend ○ Plugins ○ Custom Assertions ● Lots of Plugins ○ Jenkins
  • 5. What about browser testing? ● User Stories ○ Similar to Ruby's Cucumber ● Multiple Browsers ○ Goutte ○ Selenium ○ WebDriver ○ Sahi ○ Zombie
  • 6. 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
  • 7. 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
  • 8. 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
  • 10. 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!
  • 11. 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