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.

Requirements

  • 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
 14 Hours

Number of participants



Price per participant

Testimonials (1)

Related Categories