mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Tests > refactoring
This commit is contained in:
@@ -14,7 +14,6 @@ use Meritoo\Common\Exception\Type\UnknownOopVisibilityTypeException;
|
||||
use Meritoo\Common\Type\OopVisibilityType;
|
||||
use Meritoo\Common\Utilities\Miscellaneous;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use ReflectionMethod;
|
||||
use stdClass;
|
||||
|
||||
@@ -172,7 +171,6 @@ trait BaseTestCaseTrait
|
||||
* @param int $requiredArgumentsCount (optional) Expected count/amount of required arguments
|
||||
* of the verified method
|
||||
* @throws UnknownOopVisibilityTypeException
|
||||
* @throws ReflectionException
|
||||
*
|
||||
* Attention. 2nd argument, the $method, may be:
|
||||
* - string - name of the method
|
||||
@@ -229,8 +227,6 @@ trait BaseTestCaseTrait
|
||||
* @param int $argumentsCount (optional) Expected count/amount of arguments of the verified method
|
||||
* @param int $requiredArgumentsCount (optional) Expected count/amount of required arguments of the verified
|
||||
* method
|
||||
* @throws ReflectionException
|
||||
* @throws UnknownOopVisibilityTypeException
|
||||
*/
|
||||
protected static function assertConstructorVisibilityAndArguments(
|
||||
$classNamespace,
|
||||
@@ -244,14 +240,19 @@ trait BaseTestCaseTrait
|
||||
$reflection = new ReflectionClass($classNamespace);
|
||||
$method = $reflection->getConstructor();
|
||||
|
||||
static::assertMethodVisibilityAndArguments($classNamespace, $method, $visibilityType, $argumentsCount, $requiredArgumentsCount);
|
||||
static::assertMethodVisibilityAndArguments(
|
||||
$classNamespace,
|
||||
$method,
|
||||
$visibilityType,
|
||||
$argumentsCount,
|
||||
$requiredArgumentsCount
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that class with given namespace has no constructor
|
||||
*
|
||||
* @param string $classNamespace Namespace of class that contains constructor to verify
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
protected static function assertHasNoConstructor($classNamespace)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user