mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 01:31:45 +01:00
Tests - verifyMethodVisibilityAndArguments() method - implementation
This commit is contained in:
@@ -10,8 +10,8 @@ namespace Meritoo\Common\Tests\Collection;
|
||||
|
||||
use ArrayIterator;
|
||||
use Meritoo\Common\Collection\Collection;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use ReflectionClass;
|
||||
use Meritoo\Common\Type\OopVisibilityType;
|
||||
use Meritoo\Common\Utilities\TestCase;
|
||||
|
||||
/**
|
||||
* Tests of the collection of elements
|
||||
@@ -19,7 +19,7 @@ use ReflectionClass;
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class CollectionTest extends PHPUnit_Framework_TestCase
|
||||
class CollectionTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* An empty collection
|
||||
@@ -306,12 +306,7 @@ class CollectionTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function testExistsVisibilityAndArguments()
|
||||
{
|
||||
$reflection = new ReflectionClass(Collection::class);
|
||||
$method = $reflection->getMethod('exists');
|
||||
|
||||
self::assertTrue($method->isPrivate());
|
||||
self::assertEquals(1, $method->getNumberOfParameters());
|
||||
self::assertEquals(1, $method->getNumberOfRequiredParameters());
|
||||
$this->verifyMethodVisibilityAndArguments(Collection::class, 'exists', OopVisibilityType::IS_PRIVATE, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Meritoo\Common\Tests\Utilities;
|
||||
|
||||
use DateTime;
|
||||
use Generator;
|
||||
use Meritoo\Common\Type\OopVisibilityType;
|
||||
use Meritoo\Common\Utilities\DatePeriod;
|
||||
use Meritoo\Common\Utilities\TestCase;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* Tests of date's period
|
||||
@@ -24,12 +24,7 @@ class DatePeriodTest extends TestCase
|
||||
{
|
||||
public function testConstructorVisibilityAndArguments()
|
||||
{
|
||||
$reflection = new ReflectionClass(DatePeriod::class);
|
||||
$constructor = $reflection->getConstructor();
|
||||
|
||||
self::assertTrue($constructor->isPublic());
|
||||
self::assertEquals(2, $constructor->getNumberOfParameters());
|
||||
self::assertEquals(0, $constructor->getNumberOfRequiredParameters());
|
||||
$this->verifyConstructorVisibilityAndArguments(DatePeriod::class, OopVisibilityType::IS_PUBLIC, 2, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user