Unit Testing

Download php eBook


  • Complete list of assertions. Examples:
  • assertTrue(bool $condition[, string $messageIfFalse = '']);
  • assertEquals(mixed $expected, mixed $actual[, string $messageIfNotEqual = '']);


Unit tests are used for testing source code to see if it contains deals with inputs as we expect. Unit tests are supported by the majority of frameworks. There are several different PHPUnit tests and they might differ in syntax. In this example we are using PHPUnit.

Related Examples


270 Contributors: 5
Wednesday, January 4, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook