Course Code: phpunittesting
Duration: 14 hours
Prerequisites:
  • A solid foundation in PHP coding
  • Experience with testing is helpful, but not required

Audience

  • Intermediate to advanced PHP developers who want to improve the testability of their code
Overview:

PHPUnit is a unit testing framework for PHP. PHPUnit employs strict parameters to determine whether individual units of code are bug-free and ready for deployment. By isolating and testing individual units, developers can ensure greater application stability, avoid regression bugs, and reduce the costs associated with malfunctioning code in production.

This instructor-led, live training teaches participants how to write testable code in the form of testing units to facilitate the diagnosis, isolation, and resolution of bugs. The training walks participants through the creation of a work-ready, testing environment using the PHPUnit testing framework.

By the end of this training, participants will be able to:

  • Distinguish between good and bad testing units.
  • Read and interpret test results.
  • Proactively manage and diagnose their code base to reduce bugs.
  • Ensure that their code base is fit for continuous integration and deployment.

Format of the course

  • Part lecture, part discussion, exercises and heavy hands-on practice
Course Outline:

Day 1: Introduction to Unit Testing and PHPUnit

1. Introduction to Software Testing

  • The importance of tests in the software lifecycle
  • Overview of test types: unit, integration, system

2. Basics of Unit Testing

  • Definition and objectives of unit testing
  • Advantages of introducing unit tests to a project

3. Introduction to PHPUnit

  • Installation and configuration of the environment
  • Structure of a unit test: setup, test cases, teardown
  • Basic assertions and annotations in PHPUnit

4. First Steps in Writing Tests

  • Creating simple tests for functions and methods
  • Organizing tests: grouping, dependencies, excluding tests

5. Practice: Creating Tests for a Sample Application

  • Practical exercises: writing tests for an existing class
  • Analyzing test results, dealing with errors

Day 2: Advanced Techniques and Best Practices

6. Testing Behaviors with Mock Objects

  • Introduction to mocking and stubbing
  • Examples of using mocks in PHPUnit to simulate dependencies

7. Advanced Assertions and Annotations

  • Assertions concerning exceptions, arrays, objects
  • Using data providers for parameterized tests

8. Test Driven Development (TDD) with PHPUnit

  • Red-Green-Refactor cycle: from theory to practice
  • Practical example of TDD application in a project

9. Best Practices in Unit Testing

  • Test coverage: how to measure and interpret
  • Organization and maintenance of a unit test suite

10. Tools and Extensions Supporting PHPUnit

  • Overview of useful tools and libraries
  • Test automation: integration with CI/CD systems

11. Summary and Discussion

  • Discussion of the biggest challenges and common mistakes
  • Answers to questions, sharing participants' experiences

This training plan is designed to ensure participants have a solid foundation in unit testing and practical skills in using PHPUnit. The balance between theory and practice allows for a better understanding of the material and application of learning in real projects.

This is example outline. To customize course outline to your specific expectations please contact NobleProg.

Sites Published:

United Arab Emirates - Unit Testing with PHPUnit

Qatar - Unit Testing with PHPUnit

Egypt - Unit Testing with PHPUnit

Saudi Arabia - Unit Testing with PHPUnit

South Africa - Unit Testing with PHPUnit

Brasil - Unit Testing with PHPUnit

Canada - Unit Testing with PHPUnit

中国 - Unit Testing with PHPUnit

香港 - Unit Testing with PHPUnit

澳門 - Unit Testing with PHPUnit

台灣 - Unit Testing with PHP

USA - Unit Testing with PHPUnit

Österreich - Unit Testing with PHPUnit

Schweiz - Unit Testing with PHPUnit

Deutschland - Unit Testing with PHPUnit

Czech Republic - Unit Testing with PHPUnit

Denmark - Unit Testing with PHPUnit

Estonia - Unit Testing with PHPUnit

Finland - Unit Testing with PHPUnit

Greece - Unit Testing with PHPUnit

Magyarország - Unit Testing with PHPUnit

Ireland - Unit Testing with PHPUnit

Luxembourg - Unit Testing with PHPUnit

Latvia - Unit Testing with PHPUnit

España - Pruebas Unitarias con PHP

Italia - Unit Testing with PHPUnit

Lithuania - Unit Testing with PHPUnit

Nederland - Unit Testing with PHPUnit

Norway - Unit Testing with PHPUnit

Portugal - Unit Testing with PHPUnit

România - Unit Testing with PHPUnit

Sverige - Unit Testing with PHPUnit

Türkiye - Unit Testing with PHPUnit

Malta - Unit Testing with PHPUnit

Belgique - Unit Testing with PHPUnit

France - Unit Testing with PHPUnit

日本 - Unit Testing with PHPUnit

Australia - Unit Testing with PHPUnit

Malaysia - Unit Testing with PHPUnit

New Zealand - Unit Testing with PHPUnit

Philippines - Unit Testing with PHPUnit

Singapore - Unit Testing with PHPUnit

Thailand - Unit Testing with PHPUnit

Vietnam - Unit Testing with PHPUnit

India - Unit Testing with PHPUnit

Argentina - Pruebas Unitarias con PHP

Chile - Pruebas Unitarias con PHP

Costa Rica - Pruebas Unitarias con PHP

Ecuador - Pruebas Unitarias con PHP

Guatemala - Pruebas Unitarias con PHP

Colombia - Pruebas Unitarias con PHP

México - Pruebas Unitarias con PHP

Panama - Pruebas Unitarias con PHP

Peru - Pruebas Unitarias con PHP

Uruguay - Pruebas Unitarias con PHP

Venezuela - Pruebas Unitarias con PHP

Polska - Testy jednostkowe z wykorzystaniem PHPUnit

United Kingdom - Unit Testing with PHPUnit

South Korea - Unit Testing with PHPUnit

Pakistan - Unit Testing with PHPUnit

Sri Lanka - Unit Testing with PHPUnit

Bulgaria - Unit Testing with PHPUnit

Bolivia - Pruebas Unitarias con PHP

Indonesia - Unit Testing with PHPUnit

Kazakhstan - Unit Testing with PHPUnit

Moldova - Unit Testing with PHPUnit

Morocco - Unit Testing with PHPUnit

Tunisia - Unit Testing with PHPUnit

Kuwait - Unit Testing with PHPUnit

Oman - Unit Testing with PHPUnit

Slovakia - Unit Testing with PHPUnit

Kenya - Unit Testing with PHPUnit

Nigeria - Unit Testing with PHPUnit

Botswana - Unit Testing with PHPUnit

Slovenia - Unit Testing with PHPUnit

Croatia - Unit Testing with PHPUnit

Serbia - Unit Testing with PHPUnit

Bhutan - Unit Testing with PHPUnit

Nepal - Unit Testing with PHPUnit

Uzbekistan - Unit Testing with PHPUnit