Call : (+91) 968636 4243
Mail : info@EncartaLabs.com
EncartaLabs

Unit Testing with PHPUnit

( Duration: 3 Days )

Unit Testing with PHPUnit training course covers installing phpunit, writing and executing unit tests suites using phpunit framework.

  • Good knowledge of PHP

COURSE AGENDA

1

Introduction To Unit Test

  • What are unit tests ?
  • Pros and cons
  • The FIRST rule
2

Introduction To Php Unit

  • Introduction to PHP Unit
  • Open Source PHP projects use PHP Unit
  • IDEs integration
  • PHPUnit installation from PEAR
3

Write Your First Assertions

  • Introduction to the Command Line Interface
  • Write a first tests suite
  • Run the test suite from the command line tool
4

Initialize And Reset A Test

  • Setup a tests suite with the setup() method
  • Reset a testing environment with the tearDown() method
  • Introduction to fixtures
5

Testing Exceptions

  • Write unit tests for methods, which can handle exceptions
  • Testing exception with the setExpectedException() assertion method
  • Testing exception by using the @expectedException annotation
  • Testing exception thanks to a try { } catch code block
6

Test Driven Development

  • Understanding the test driven development (TDD) methodology
  • Main advantages of the TDD approach
  • Implement code thanks to a test driven development approach
7

Data Providers And Fixtures

  • Understanding the data providers and fixtures concepts
  • Create a new data provider method to run a test with several values
8

Advanced Testing Practices

  • Testing exceptions
  • Using data providers to create fixtures
  • Assertions to test a class and its attributes
  • Assertions to test Boolean values
  • Assertions to test string values
  • Assertions to test XML values
9

Code Coverage Analysis

  • Understanding the code coverage concept
  • Check XDebug extension is installed on the web server
  • Generate a complete code coverage report from the command line interface
  • Analyzing and understanding generated reports and statistics
  • Understanding and using the special @covers annotation
  • Ignore code blocks from coverage process thanks to @codeCoverageIgnore (Start|End) annotation
10

Using Mock Objects

  • Discovering and creating mock objects
  • Test data model coupled to mock objects
  • Check code coverage rate thanks to advanced unit tests
11

Generating Reports

  • Export results as XML
  • Export results as JSON
  • Export results as TAP
  • Check code coverage rate thanks to advanced unit tests
12

Monitoring The Tests Suite With Jenkins

  • Discovering the continuous integration practice
  • Installing and running a continuous integration tool

Encarta Labs Advantage

  • One Stop Corporate Training Solution Providers for over 6,000 various courses on a variety of subjects
  • All courses are delivered by Industry Veterans
  • Get jumpstarted from newbie to production ready in a matter of few days
  • Trained more than 50,000 Corporate executives across the Globe
  • All our trainings are conducted in workshop mode with more focus on hands-on sessions

View our other course offerings by visiting https://www.encartalabs.com/course-catalogue-all.php

Contact us for delivering this course as a public/open-house workshop/online training for a group of 10+ candidates.

Top
Notice
X