mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
BaseTestCase - make static and rename methods (start names of methods with "assert" instead of "verify")
This commit is contained in:
@@ -135,7 +135,7 @@ abstract class BaseTestCase extends TestCase
|
|||||||
* - string - name of the method
|
* - string - name of the method
|
||||||
* - instance of ReflectionMethod - just the method (provided by ReflectionClass::getMethod() method)
|
* - instance of ReflectionMethod - just the method (provided by ReflectionClass::getMethod() method)
|
||||||
*/
|
*/
|
||||||
protected function verifyMethodVisibilityAndArguments(
|
protected static function assertMethodVisibilityAndArguments(
|
||||||
$classNamespace,
|
$classNamespace,
|
||||||
$method,
|
$method,
|
||||||
$visibilityType,
|
$visibilityType,
|
||||||
@@ -188,7 +188,7 @@ abstract class BaseTestCase extends TestCase
|
|||||||
* method
|
* method
|
||||||
* @throws UnknownOopVisibilityTypeException
|
* @throws UnknownOopVisibilityTypeException
|
||||||
*/
|
*/
|
||||||
protected function verifyConstructorVisibilityAndArguments(
|
protected static function assertConstructorVisibilityAndArguments(
|
||||||
$classNamespace,
|
$classNamespace,
|
||||||
$visibilityType,
|
$visibilityType,
|
||||||
$argumentsCount = 0,
|
$argumentsCount = 0,
|
||||||
@@ -200,7 +200,7 @@ abstract class BaseTestCase extends TestCase
|
|||||||
$reflection = new ReflectionClass($classNamespace);
|
$reflection = new ReflectionClass($classNamespace);
|
||||||
$method = $reflection->getConstructor();
|
$method = $reflection->getConstructor();
|
||||||
|
|
||||||
return $this->verifyMethodVisibilityAndArguments($classNamespace, $method, $visibilityType, $argumentsCount, $requiredArgumentsCount);
|
return static::assertMethodVisibilityAndArguments($classNamespace, $method, $visibilityType, $argumentsCount, $requiredArgumentsCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ class CollectionTest extends BaseTestCase
|
|||||||
|
|
||||||
public function testExistsVisibilityAndArguments()
|
public function testExistsVisibilityAndArguments()
|
||||||
{
|
{
|
||||||
$this->verifyMethodVisibilityAndArguments(Collection::class, 'exists', OopVisibilityType::IS_PRIVATE, 1, 1);
|
static::assertMethodVisibilityAndArguments(Collection::class, 'exists', OopVisibilityType::IS_PRIVATE, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class DatePeriodTest extends BaseTestCase
|
|||||||
{
|
{
|
||||||
public function testConstructorVisibilityAndArguments()
|
public function testConstructorVisibilityAndArguments()
|
||||||
{
|
{
|
||||||
$this->verifyConstructorVisibilityAndArguments(DatePeriod::class, OopVisibilityType::IS_PUBLIC, 2, 0);
|
static::assertConstructorVisibilityAndArguments(DatePeriod::class, OopVisibilityType::IS_PUBLIC, 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user