herrera-io/phpunit-test-case
PHPUnit TestCase class and Extras trait that add helpers for common test chores: create/delete temporary files and directories, call protected/private methods, and get/set protected/private properties. Use as a base class or mix into your own test case.
A PHPUnit test case class and trait with additional functionality.
The TestCase class and Extras trait provide additional methods for performing basic, repetitive tasks such as:
NOTE Both
TestCaseandExtrasare identical, except the former being a class and the latter being a trait.
Add it to your list of Composer dependencies:
$ composer require herrera-io/phpunit-test-case=1.*
TestCase class<?php
class MyTestCase extends Herrera\PHPUnit\TestCase
{
// my tests
}
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.
How can I help you explore Laravel packages today?