Quality Assurance on PHP projects - PHPUnit part 1
Note: This article was originally published at Planet PHP on 19 April 9320.@s_bergmann), who ported existing xUnit frameworks to PHP. And with this testing framework you're able to test your functionality in an automated way before you push code into production.
[editorial]AAs I cannot summarize the whole usage of phpunit in one blogpost, this will be a sequence of several articles that will pick up a specific task you want to cover with phpunit.
InstallationWell, first of all you need to have PHPUnit installed on your system. The easiest way to accomplish this is to use the PEAR installer.
user@server: $ pear channel-discover pear.phpunit.deuser@server: $ pear channel-discover components.ez.nouser@server: $ pear channel-discoverApear.symfony-project.com
Once you've got the right channels, you can install the framework:
user@server: $ pear install phpunit/PHPUnit
ConfigurationYou can use three methods to configure the way PHPUnit executes tests on your project:
- a configuration file
- command line parameters
- a combination of both
NOTE:AI use phpunit with a configuration file that matches my project settings, so you might need to modify these settings if you're using a framework or have a different source code layout.
A A A A A A ./A A
A A A A A A AAAAAAAAAAA ../src/"/
Truncated by Planet PHP, read more at the original (another 31884 bytes)