mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Arrays > getNonEmptyValuesAsString() method > returns non-empty values concatenated by given separator
1.3 KiB
1.3 KiB
Meritoo Common Library
Common and useful classes, methods, exceptions etc.
Base test case (with common methods and data providers)
Located here: Meritoo\Common\Test\Base\BaseTestCase. Just extend the BaseTestCase class and use it like in Meritoo\Common\Test\Utilities\DateTest class:
class DateTest extends BaseTestCase
{
/**
* @param mixed $value Empty value, e.g. ""
* @dataProvider provideEmptyValue
*/
public function testGetDateTimeEmptyValue($value)
{
self::assertFalse(Date::getDateTime($value));
}
(...)
}
or in Meritoo\Common\Test\Utilities\MimeTypesTest class:
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));
}
(...)
}