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