From 989c5996a53aef283397976fbfce60f6e0a5b72b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 18 Nov 2023 10:55:18 +0000 Subject: [PATCH] daily-email: add 2023-11-13 PHPUnit does more than unit testing --- src/content/daily-email/2023-11-13.md | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/content/daily-email/2023-11-13.md diff --git a/src/content/daily-email/2023-11-13.md b/src/content/daily-email/2023-11-13.md new file mode 100644 index 00000000..8974fbdf --- /dev/null +++ b/src/content/daily-email/2023-11-13.md @@ -0,0 +1,34 @@ +--- +title: > + PHPUnit does more than unit testing +pubDate: 2023-11-13 +permalink: > + archive/2023/11/13/phpunit-does-more-than-unit-testing +tags: + - software-development + - automated-testing + - software-development + - test-driven-development + - phpunit + - php + - drupal + - symfony +--- + +As the name suggests, [PHPUnit][] is a unit testing framework for PHP. + +It's the defacto PHP testing framework used by the major PHP projects, such as Drupal, Symfony, Laravel. + +But unit testing isn't all that PHPUnit can do. + +These frameworks extend PHPUnit to give it more functionality. + +Drupal allows you to run functional/browser tests to make requests to pages, check the response codes and content, as well as integration/kernel tests to test real services instead of relying on mocking within unit tests. + +Symfony does the same with its web and kernel test cases. + +## There's the thing... + +If you use a framework and want to more than unit testing, intsead of including another testing framework, try using some of the PHPUnit extensions that are provided by the framework. + +[phpunit]: http://phpunit.de