herrera-io / phpunit-test-case
A PHPUnit test case class with additional functionality.
Installs: 5 335
Dependents: 21
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
pkg:composer/herrera-io/phpunit-test-case
Requires
- php: >=5.3.3
- phpunit/phpunit: 3.7.*
Requires (Dev)
- symfony/process: ~2.1
Suggests
- symfony/process: To run command line applications.
This package is not auto-updated.
Last update: 2021-12-07 01:35:21 UTC
README
A PHPUnit test case class and trait with additional functionality.
Summary
The TestCase class and Extras trait provide additional methods for performing basic, repetitive tasks such as:
- creating and deleting temporary files and directories
- calling protected and private methods
- retrieving and setting protected and private properties
NOTE Both
TestCaseandExtrasare identical, except the former being a class and the latter being a trait.
Installation
Add it to your list of Composer dependencies:
$ composer require herrera-io/phpunit-test-case=1.*
Usage
The TestCase class
<?php class MyTestCase extends Herrera\PHPUnit\TestCase { // my tests }
The Extras trait
<?php class MyTestCase extends My\Own\Custom\TestCase { use Herrera\PHPUnit\Extras; // my tests }
NOTE If your test class provides its own
tearDown()method, make sure to call the class's or trait'stearDown()method as well.TestCaseandExtrasuses the tear down process to clean up temporary files and directories.