Common and useful classes, methods, exceptions etc.
Located here: Meritoo\Common\Test\Base\BaseTestCase
.
- Just extend the
BaseTestCase
class or implementMeritoo\Common\Traits\Test\Base\BaseTestCaseTrait
trait. - Use one of available data providers, e.g.
@dataProvider provideEmptyValue
, or asserts, e.g.static::assertMethodVisibility($method, $visibilityType);
class DateTest extends BaseTestCase
{
/**
* @param mixed $value Empty value, e.g. ""
* @dataProvider provideEmptyValue
*/
public function testGetDateTimeEmptyValue($value)
{
self::assertFalse(Date::getDateTime($value));
}
(...)
}
class MimeTypesTest extends BaseTestCase
{
(...)
/**
* @param bool $mimeType The mime type, e.g. "video/mpeg"
* @dataProvider provideBooleanValue
*/
public function testGetExtensionBooleanMimeType($mimeType)
{
self::assertEquals('', MimeTypes::getExtension($mimeType));
}
(...)
}