mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 01:31:45 +01:00
BaseTestCase - assertHasNoConstructor() method - asserts that class with given namespace has no constructor
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities;
|
||||
|
||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||
use Meritoo\Common\Utilities\Arrays;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Tests of the useful arrays methods
|
||||
@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class ArraysTest extends TestCase
|
||||
class ArraysTest extends BaseTestCase
|
||||
{
|
||||
private $simpleArray;
|
||||
private $simpleArrayWithKeys;
|
||||
@@ -25,6 +25,11 @@ class ArraysTest extends TestCase
|
||||
private $complexArray;
|
||||
private $superComplexArray;
|
||||
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Arrays::class);
|
||||
}
|
||||
|
||||
public function testValues2string()
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities;
|
||||
|
||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||
use Meritoo\Common\Utilities\Bundle;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Tests of the useful methods for bundle
|
||||
@@ -17,8 +17,13 @@ use PHPUnit\Framework\TestCase;
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class BundleTest extends TestCase
|
||||
class BundleTest extends BaseTestCase
|
||||
{
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Bundle::class);
|
||||
}
|
||||
|
||||
public function testGetBundleViewPathEmptyPathAndBundle()
|
||||
{
|
||||
self::assertNull(Bundle::getBundleViewPath('', ''));
|
||||
|
||||
@@ -27,6 +27,11 @@ class ComposerTest extends BaseTestCase
|
||||
*/
|
||||
private $composerJsonPath;
|
||||
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Composer::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $composerJsonPath Empty value, e.g. ""
|
||||
* @dataProvider provideEmptyValue
|
||||
|
||||
@@ -23,6 +23,11 @@ use Meritoo\Common\Utilities\Date;
|
||||
*/
|
||||
class DateTest extends BaseTestCase
|
||||
{
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Date::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value Empty value, e.g. ""
|
||||
* @dataProvider provideEmptyValue
|
||||
|
||||
@@ -19,6 +19,11 @@ use Meritoo\Common\Utilities\GeneratorUtility;
|
||||
*/
|
||||
class GeneratorUtilityTest extends BaseTestCase
|
||||
{
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(GeneratorUtility::class);
|
||||
}
|
||||
|
||||
public function testGetGeneratorElements()
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -20,6 +20,11 @@ use Meritoo\Common\Utilities\Locale;
|
||||
*/
|
||||
class LocaleTest extends BaseTestCase
|
||||
{
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Locale::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $languageCode Empty value, e.g. ""
|
||||
* @dataProvider provideEmptyValue
|
||||
|
||||
@@ -20,6 +20,11 @@ use Meritoo\Common\Utilities\MimeTypes;
|
||||
*/
|
||||
class MimeTypesTest extends BaseTestCase
|
||||
{
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(MimeTypes::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $mimeType Empty value, e.g. ""
|
||||
* @dataProvider provideEmptyValue
|
||||
|
||||
@@ -28,6 +28,11 @@ class MiscellaneousTest extends BaseTestCase
|
||||
private $stringCommaSeparated;
|
||||
private $stringDotSeparated;
|
||||
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Miscellaneous::class);
|
||||
}
|
||||
|
||||
public function testGetDirectoryContent()
|
||||
{
|
||||
$directoryPath = __DIR__ . '/../';
|
||||
|
||||
@@ -29,6 +29,11 @@ use Meritoo\Common\Utilities\Reflection;
|
||||
*/
|
||||
class ReflectionTest extends BaseTestCase
|
||||
{
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Reflection::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $invalidClass Empty value, e.g. ""
|
||||
* @dataProvider provideEmptyValue
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace Meritoo\Common\Utilities;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||
|
||||
/**
|
||||
* Tests of the useful regular expressions methods
|
||||
@@ -16,11 +16,16 @@ use PHPUnit\Framework\TestCase;
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class RegexTest extends TestCase
|
||||
class RegexTest extends BaseTestCase
|
||||
{
|
||||
private $simpleText;
|
||||
private $camelCaseText;
|
||||
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Regex::class);
|
||||
}
|
||||
|
||||
public function testGetCamelCaseParts()
|
||||
{
|
||||
$parts = [];
|
||||
|
||||
@@ -19,6 +19,11 @@ use Meritoo\Common\Utilities\Uri;
|
||||
*/
|
||||
class UriTest extends BaseTestCase
|
||||
{
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Uri::class);
|
||||
}
|
||||
|
||||
public function testAddProtocolToUrl()
|
||||
{
|
||||
$http = 'http';
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities;
|
||||
|
||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||
use Meritoo\Common\Utilities\Xml;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleXMLElement;
|
||||
|
||||
/**
|
||||
@@ -18,11 +18,16 @@ use SimpleXMLElement;
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class XmlTest extends TestCase
|
||||
class XmlTest extends BaseTestCase
|
||||
{
|
||||
private $simpleXml;
|
||||
private $advancedXml;
|
||||
|
||||
public function verifyConstructor()
|
||||
{
|
||||
static::assertHasNoConstructor(Xml::class);
|
||||
}
|
||||
|
||||
public function testMergeNodes()
|
||||
{
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user