From a0d28b326e9a90fe5e1560e3b1a5f40be21b9be1 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 21 Sep 2017 16:52:15 +0200 Subject: [PATCH] BaseTestCase - make static and rename methods (start names of methods with "assert" instead of "verify") --- src/Meritoo/Common/Test/Base/BaseTestCase.php | 6 +++--- tests/Meritoo/Common/Test/Collection/CollectionTest.php | 2 +- tests/Meritoo/Common/Test/Utilities/DatePeriodTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Meritoo/Common/Test/Base/BaseTestCase.php b/src/Meritoo/Common/Test/Base/BaseTestCase.php index 7a5c1d5..ee7db79 100644 --- a/src/Meritoo/Common/Test/Base/BaseTestCase.php +++ b/src/Meritoo/Common/Test/Base/BaseTestCase.php @@ -135,7 +135,7 @@ abstract class BaseTestCase extends TestCase * - string - name of the method * - instance of ReflectionMethod - just the method (provided by ReflectionClass::getMethod() method) */ - protected function verifyMethodVisibilityAndArguments( + protected static function assertMethodVisibilityAndArguments( $classNamespace, $method, $visibilityType, @@ -188,7 +188,7 @@ abstract class BaseTestCase extends TestCase * method * @throws UnknownOopVisibilityTypeException */ - protected function verifyConstructorVisibilityAndArguments( + protected static function assertConstructorVisibilityAndArguments( $classNamespace, $visibilityType, $argumentsCount = 0, @@ -200,7 +200,7 @@ abstract class BaseTestCase extends TestCase $reflection = new ReflectionClass($classNamespace); $method = $reflection->getConstructor(); - return $this->verifyMethodVisibilityAndArguments($classNamespace, $method, $visibilityType, $argumentsCount, $requiredArgumentsCount); + return static::assertMethodVisibilityAndArguments($classNamespace, $method, $visibilityType, $argumentsCount, $requiredArgumentsCount); } /** diff --git a/tests/Meritoo/Common/Test/Collection/CollectionTest.php b/tests/Meritoo/Common/Test/Collection/CollectionTest.php index bfeb579..9fa0309 100644 --- a/tests/Meritoo/Common/Test/Collection/CollectionTest.php +++ b/tests/Meritoo/Common/Test/Collection/CollectionTest.php @@ -306,7 +306,7 @@ class CollectionTest extends BaseTestCase public function testExistsVisibilityAndArguments() { - $this->verifyMethodVisibilityAndArguments(Collection::class, 'exists', OopVisibilityType::IS_PRIVATE, 1, 1); + static::assertMethodVisibilityAndArguments(Collection::class, 'exists', OopVisibilityType::IS_PRIVATE, 1, 1); } /** diff --git a/tests/Meritoo/Common/Test/Utilities/DatePeriodTest.php b/tests/Meritoo/Common/Test/Utilities/DatePeriodTest.php index ccc8d60..af8ff69 100644 --- a/tests/Meritoo/Common/Test/Utilities/DatePeriodTest.php +++ b/tests/Meritoo/Common/Test/Utilities/DatePeriodTest.php @@ -24,7 +24,7 @@ class DatePeriodTest extends BaseTestCase { public function testConstructorVisibilityAndArguments() { - $this->verifyConstructorVisibilityAndArguments(DatePeriod::class, OopVisibilityType::IS_PUBLIC, 2, 0); + static::assertConstructorVisibilityAndArguments(DatePeriod::class, OopVisibilityType::IS_PUBLIC, 2, 0); } /**