TESTC1 | Write your first unit tests with PHPUnit and Advanced and functional tests with Symfony

  • This day course lets learners know what, when and how to test PHP code and shows the different workings of functional testing.
  • Prerequisites

    Personal skills: Good use of PHP, IDE (PHPStorm prefered) and Symfony. Required tools: PHP 7.2.5 or above, Composer, Symfony CLI.
  • Goals

    Thanks to the flagship features of PHPUnit, the learners will be able to obtain complete code coverage, through classes and test scenarios, according to specific standards and good practices. They will use all the tools (Client, Profiler, DomCrawler...) allowing to carry out complete functional test scenarios, in accordance with their Symfony application.

Full program

Introduction

  • Context and definitions
  • for or against
  • What to test, when to test?

Writing unit tests with PHPUnit

  • Installation of the PHPUnit test framework
  • Write your first class of unit test scenarios according to standards
  • Test dependencies
  • Test exceptions
  • Use data providers
  • Calculate your coverage code
  • Use CLI options
  • Fixtures and database tests
  • Create your own assertions
  • TP

Introduction to double test

  • Definitions and concepts of doubles (Stub, Dummy, Mock),
  • Create your first plug (Stub) with createMock () and therefore getMockBuilder (),
  • Mocking a class: multiple arguments, expectations, returns, traits, summaries,
  • Prophecy to create liners,
  • TP

Introduction to functional tests

  • Definitions and concepts,
  • Create your first smoke test,
  • Test with the client
  • Test with DomCrawler
  • Profiler test
  • TP

Time program

Day 1

Appreciation of the training

Global average : 3.4/5

  1. Educational rating : 4.0/5
  2. Content rating : 3.2/5
  3. Pace rating : 3.0/5
  • Duration

    7 hour(s)
  • Level

    Beginner
  • Available languages

    French
  • Available countries

    Worldwide
From €780.00
1 upcoming session

You are not available at this periods? We organize tailored training courses: contact us for more informations!