SlideShare a Scribd company logo
Thomas Dutrion / @tdutrion - October 2014
Codeception
Introduction to PHP testing
About me
@tdutrion / @engineor / thomas@engineor.com
● Founder and developer/architect at Engineor
● Working with PHP since 2003
● Trying to work properly...
PHP3: simple web pages
PHP4: object? are you kidding?
PHP5: mature language, with namespaces, real objects and so on…
What is missing to compete with other languages?
TESTABILITY
Codeception
PHP best practice: industrialisation
● Unit testing
● Integration testing
● Functional testing
● Acceptance testing
● Mutation testing
● Monkey testing
● ...
Codeception
What can we test?
And you, how are you testing?
● Small unit of code
● SOLID principle (single Responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion)
● Requires complete isolation
● Long to write, requires continuous updates, expensive
=> very good for critical parts of the application!
Codeception
Unit testing
● Test modules as groups
● Simulate input
● Less work than Unit testing (smaller number of tests)
Codeception
Integration testing
● Test final application appearance
● Reproduce complete application execution
● Client point of view
● Less code, final result only, help on legacy projects
=> Can be used to prove the completion of the project
Codeception
Acceptance testing
Codeception
One tool: Codeception
General introduction
Codeception
History:
● Started in 2011
● Stable release in January 2012
● Version 2.1.3 in this month!
● Currently 4267 commits
● 295 contributors...
Problem solved:
● Bridge between all testing types
● No other languages required
● Extensible
● Covers major frameworks
Codeception
PHP 5.4 minimum (use at least 5.6 anyways!)
You already know it!
Based on recommended and proven tools
● PHPUnit
● Symfony browserkit
● Selenium / PhantomJS (optional)
● …
Test suite written in PHP => no need to learn another language.
Codeception
Follow the quickstart!
1. Install codeception (prefer using composer, globally or in dev only)
2. Bootstrap (directories and files structure, basic configuration)
3. Generate acceptance testing
4. Write tests
5. And run!
Codeception
Acceptance testing 101
$ php vendor/bin/codecept run
Codeception PHP Testing Framework v2.0.5
Powered by PHPUnit 4.2.5 by Sebastian Bergmann.
Acceptance Tests (1) ------------------------------------------------------------------------------------------------------------
Trying to ensure that frontpage works (WelcomeCept) Ok
---------------------------------------------------------------------------------------------------------------------------------
Functional Tests (0) ---------------------------------------------------------------------
Unit Tests (0) ---------------------------------------------------------------------------
Time: 382 ms, Memory: 8.50Mb
OK (1 test, 1 assertion)
Codeception
Basic example results (pass)
Acceptance Tests (1) ------------------------------------------------------------------------------------------------------------
Trying to ensure that frontpage works (WelcomeCept) Fail
There was 1 failure:
1) Failed to ensure that frontpage works in WelcomeCept (/Users/thomas/NetBeansProjects/Codeception01/tests/acceptance/WelcomeCept.
php)
Couldn't see "Not ok":
Failed asserting that /
→ Your HTML code here
[Content too long to display. See complete response in '_output' directory]
--> contains "not ok".
Scenario Steps:
2. I see "Not ok"
1. I am on page "/"
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
Codeception
Basic example results (fail)
● Since 2005, AJAX is everywhere (XmlHttpRequest)
● New architecture: MVVM javascript in front, PHP/node… in back
Testing problem: PHPBrowser / Curl can not read javascript modifications.
=> Codeception can work with Selenium!
Codeception
What about sexy frontends?
Demonstration: Firefox run
● No Firefox and or java on your servers => no Selenium on CI
● CI usually run only simple bash scripts
● Need to run the test in command line, emulating an headless browser
=> Codeception PhantomJS driver
Codeception
Headless testing for Continuous Integration
Codeception
Demonstration: headless run
Workflow improvement
Codeception
● Use Docker containers or Vagrant virtual boxes to add development, testing
and production servers configuration to your VCS repository
● Add CI server triggered on commits, with email results
Questions?
Codeception: introduction to PHP testing, by Thomas Dutrion from Engineor for Aberdeen PHP, October 2015
Special thanks to / reading recommendation:
● Jeremy Coates (@phpcodemonkey) for Testing with codeception
● PHPNW (@phpnw), great PHP group that made me discover Codeception
● All of you for your patience and supporting my French accent!
● Aberdeen PHP (@AberdeenPHP) to let me talk here
Please rate and comment this talk on SlideShare: http://goo.gl/JRd4W5
Ad

Recommended

Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Engineor
 
Testing PHP with Codeception
Testing PHP with Codeception
John Paul Ada
 
Test automation with php codeception
Test automation with php codeception
buddhieash
 
CI / CD w/ Codeception
CI / CD w/ Codeception
Tudor Barbu
 
Testing with Codeception
Testing with Codeception
Jeremy Coates
 
Codeception: introduction to php testing
Codeception: introduction to php testing
Engineor
 
Codeception
Codeception
Jonathan Lau
 
Codeception presentation
Codeception presentation
Andrei Burian
 
PHP Unit Testing in Yii
PHP Unit Testing in Yii
IlPeach
 
Codeception introduction and use in Yii
Codeception introduction and use in Yii
IlPeach
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
Adam Štipák
 
Codeception
Codeception
少東 張
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Cogapp
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Joe Ferguson
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
Joe Ferguson
 
Automation testing with Drupal 8
Automation testing with Drupal 8
nagpalprachi
 
Nginx pres
Nginx pres
James Fuller
 
Automated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie Miners
 
Continuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriver
AOE
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
Franz Allan See
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
James Fuller
 
Integration Testing in Python
Integration Testing in Python
Panoptic Development, Inc.
 
Unit testing - A&BP CC
Unit testing - A&BP CC
JWORKS powered by Ordina
 
How do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and Client
ColdFusionConference
 
Robot framework
Robot framework
Rochak Bhalla
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
ColdFusionConference
 
Python in Test automation
Python in Test automation
Krishnana Sreeraman
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
Shyam Sunder Verma
 
Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8
Sam Becker
 

More Related Content

What's hot (20)

PHP Unit Testing in Yii
PHP Unit Testing in Yii
IlPeach
 
Codeception introduction and use in Yii
Codeception introduction and use in Yii
IlPeach
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
Adam Štipák
 
Codeception
Codeception
少東 張
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Cogapp
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Joe Ferguson
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
Joe Ferguson
 
Automation testing with Drupal 8
Automation testing with Drupal 8
nagpalprachi
 
Nginx pres
Nginx pres
James Fuller
 
Automated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie Miners
 
Continuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriver
AOE
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
Franz Allan See
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
James Fuller
 
Integration Testing in Python
Integration Testing in Python
Panoptic Development, Inc.
 
Unit testing - A&BP CC
Unit testing - A&BP CC
JWORKS powered by Ordina
 
How do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and Client
ColdFusionConference
 
Robot framework
Robot framework
Rochak Bhalla
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
ColdFusionConference
 
Python in Test automation
Python in Test automation
Krishnana Sreeraman
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
PHP Unit Testing in Yii
PHP Unit Testing in Yii
IlPeach
 
Codeception introduction and use in Yii
Codeception introduction and use in Yii
IlPeach
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
Adam Štipák
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Cogapp
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Joe Ferguson
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
Joe Ferguson
 
Automation testing with Drupal 8
Automation testing with Drupal 8
nagpalprachi
 
Automated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie Miners
 
Continuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriver
AOE
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
Franz Allan See
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
James Fuller
 
How do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and Client
ColdFusionConference
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
ColdFusionConference
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 

Similar to Codeception: introduction to php testing (v2 - Aberdeen php) (20)

Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
Shyam Sunder Verma
 
Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8
Sam Becker
 
Continuous Integration In Php
Continuous Integration In Php
Wilco Jansen
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
Bruno Tanoue
 
Pragmatic Introduction to PHP Unit Testing (2015)
Pragmatic Introduction to PHP Unit Testing (2015)
Peter Kofler
 
TDD for joomla extensions
TDD for joomla extensions
Roberto Segura
 
Codeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira Finance
Fachrul Choliluddin
 
UPC Plone Testing Talk
UPC Plone Testing Talk
Timo Stollenwerk
 
Unit testing (eng)
Unit testing (eng)
Anatoliy Okhotnikov
 
PHP - Programming language war, does it matter
PHP - Programming language war, does it matter
Mizno Kruge
 
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code Testing
Binary Studio
 
Continuous Integration at Mollie
Continuous Integration at Mollie
willemstuursma
 
Test Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShell
Hemmerling
 
Framework
Framework
Seungjoon Lee
 
Behaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’s
Andrew Kirkpatrick
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
smithmilner
 
NET Code Testing
NET Code Testing
Kirill Miroshnichenko
 
PHPUnit
PHPUnit
Hampton Roads PHP User Grop
 
Test driven development - Zombie proof your code
Test driven development - Zombie proof your code
Pascal Larocque
 
Test Driven Development with PHP
Test Driven Development with PHP
Rogério Vicente
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
Shyam Sunder Verma
 
Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8
Sam Becker
 
Continuous Integration In Php
Continuous Integration In Php
Wilco Jansen
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
Bruno Tanoue
 
Pragmatic Introduction to PHP Unit Testing (2015)
Pragmatic Introduction to PHP Unit Testing (2015)
Peter Kofler
 
TDD for joomla extensions
TDD for joomla extensions
Roberto Segura
 
Codeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira Finance
Fachrul Choliluddin
 
PHP - Programming language war, does it matter
PHP - Programming language war, does it matter
Mizno Kruge
 
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code Testing
Binary Studio
 
Continuous Integration at Mollie
Continuous Integration at Mollie
willemstuursma
 
Test Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShell
Hemmerling
 
Behaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’s
Andrew Kirkpatrick
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
smithmilner
 
Test driven development - Zombie proof your code
Test driven development - Zombie proof your code
Pascal Larocque
 
Test Driven Development with PHP
Test Driven Development with PHP
Rogério Vicente
 
Ad

Recently uploaded (20)

War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Ad

Codeception: introduction to php testing (v2 - Aberdeen php)

  • 1. Thomas Dutrion / @tdutrion - October 2014 Codeception Introduction to PHP testing
  • 2. About me @tdutrion / @engineor / [email protected] ● Founder and developer/architect at Engineor ● Working with PHP since 2003 ● Trying to work properly...
  • 3. PHP3: simple web pages PHP4: object? are you kidding? PHP5: mature language, with namespaces, real objects and so on… What is missing to compete with other languages? TESTABILITY Codeception PHP best practice: industrialisation
  • 4. ● Unit testing ● Integration testing ● Functional testing ● Acceptance testing ● Mutation testing ● Monkey testing ● ... Codeception What can we test? And you, how are you testing?
  • 5. ● Small unit of code ● SOLID principle (single Responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) ● Requires complete isolation ● Long to write, requires continuous updates, expensive => very good for critical parts of the application! Codeception Unit testing
  • 6. ● Test modules as groups ● Simulate input ● Less work than Unit testing (smaller number of tests) Codeception Integration testing
  • 7. ● Test final application appearance ● Reproduce complete application execution ● Client point of view ● Less code, final result only, help on legacy projects => Can be used to prove the completion of the project Codeception Acceptance testing
  • 9. General introduction Codeception History: ● Started in 2011 ● Stable release in January 2012 ● Version 2.1.3 in this month! ● Currently 4267 commits ● 295 contributors... Problem solved: ● Bridge between all testing types ● No other languages required ● Extensible ● Covers major frameworks
  • 10. Codeception PHP 5.4 minimum (use at least 5.6 anyways!)
  • 11. You already know it! Based on recommended and proven tools ● PHPUnit ● Symfony browserkit ● Selenium / PhantomJS (optional) ● … Test suite written in PHP => no need to learn another language. Codeception
  • 12. Follow the quickstart! 1. Install codeception (prefer using composer, globally or in dev only) 2. Bootstrap (directories and files structure, basic configuration) 3. Generate acceptance testing 4. Write tests 5. And run! Codeception Acceptance testing 101
  • 13. $ php vendor/bin/codecept run Codeception PHP Testing Framework v2.0.5 Powered by PHPUnit 4.2.5 by Sebastian Bergmann. Acceptance Tests (1) ------------------------------------------------------------------------------------------------------------ Trying to ensure that frontpage works (WelcomeCept) Ok --------------------------------------------------------------------------------------------------------------------------------- Functional Tests (0) --------------------------------------------------------------------- Unit Tests (0) --------------------------------------------------------------------------- Time: 382 ms, Memory: 8.50Mb OK (1 test, 1 assertion) Codeception Basic example results (pass)
  • 14. Acceptance Tests (1) ------------------------------------------------------------------------------------------------------------ Trying to ensure that frontpage works (WelcomeCept) Fail There was 1 failure: 1) Failed to ensure that frontpage works in WelcomeCept (/Users/thomas/NetBeansProjects/Codeception01/tests/acceptance/WelcomeCept. php) Couldn't see "Not ok": Failed asserting that / → Your HTML code here [Content too long to display. See complete response in '_output' directory] --> contains "not ok". Scenario Steps: 2. I see "Not ok" 1. I am on page "/" FAILURES! Tests: 1, Assertions: 1, Failures: 1. Codeception Basic example results (fail)
  • 15. ● Since 2005, AJAX is everywhere (XmlHttpRequest) ● New architecture: MVVM javascript in front, PHP/node… in back Testing problem: PHPBrowser / Curl can not read javascript modifications. => Codeception can work with Selenium! Codeception What about sexy frontends?
  • 17. ● No Firefox and or java on your servers => no Selenium on CI ● CI usually run only simple bash scripts ● Need to run the test in command line, emulating an headless browser => Codeception PhantomJS driver Codeception Headless testing for Continuous Integration
  • 19. Workflow improvement Codeception ● Use Docker containers or Vagrant virtual boxes to add development, testing and production servers configuration to your VCS repository ● Add CI server triggered on commits, with email results
  • 20. Questions? Codeception: introduction to PHP testing, by Thomas Dutrion from Engineor for Aberdeen PHP, October 2015 Special thanks to / reading recommendation: ● Jeremy Coates (@phpcodemonkey) for Testing with codeception ● PHPNW (@phpnw), great PHP group that made me discover Codeception ● All of you for your patience and supporting my French accent! ● Aberdeen PHP (@AberdeenPHP) to let me talk here Please rate and comment this talk on SlideShare: http://goo.gl/JRd4W5