Testing PHP

From Rixort Wiki
Revision as of 11:35, 18 December 2023 by Paul (talk | contribs) (→‎PHPUnit)
Jump to navigation Jump to search

PHPUnit

  • Any function with the prefix 'test' is considered a test (e.g. testSubtraction)
  • A test function can contain multiple assertions
  • setUp function is run before each test function
  • tearDown function is run after each test function

Psalm

PHPStan

PHPCS

PHPCBF

PHPLint

Codeception

  • Can have different 'suites' of tests

Test Driven Development

Behaviour Driver Development