Exceptions > create instance of exception using static "create()" method (instead of constructor)

This commit is contained in:
Meritoo
2018-07-02 08:52:01 +02:00
parent 9342f0e87e
commit 834b24f348
35 changed files with 139 additions and 105 deletions

View File

@@ -23,7 +23,7 @@ class TooManyChildClassesExceptionTest extends BaseTestCase
{
public function testConstructorVisibilityAndArguments()
{
static::assertConstructorVisibilityAndArguments(TooManyChildClassesException::class, OopVisibilityType::IS_PUBLIC, 2, 2);
static::assertConstructorVisibilityAndArguments(TooManyChildClassesException::class, OopVisibilityType::IS_PUBLIC, 3);
}
/**
@@ -36,7 +36,7 @@ class TooManyChildClassesExceptionTest extends BaseTestCase
*/
public function testConstructorMessage($parentClass, array $childClasses, $expectedMessage)
{
$exception = new TooManyChildClassesException($parentClass, $childClasses);
$exception = TooManyChildClassesException::create($parentClass, $childClasses);
static::assertEquals($expectedMessage, $exception->getMessage());
}