Reformat code automatically

This commit is contained in:
Meritoo
2022-02-12 14:46:47 +01:00
parent a3af138f0c
commit a3adae50b8
116 changed files with 19152 additions and 19091 deletions

View File

@@ -25,6 +25,33 @@ use stdClass;
*/
class CannotResolveClassNameExceptionTest extends BaseTestCase
{
/**
* Provides source of the class's / trait's name, information if message of this exception should be prepared for
* class and the expected exception's message
*
* @return Generator
*/
public function provideClassName(): Generator
{
yield [
'Not\Existing\Class',
true,
'Name of class from given \'string\' Not\Existing\Class cannot be resolved. Is there everything ok?',
];
yield [
'Not\Existing\Trait',
false,
'Name of trait from given \'string\' Not\Existing\Trait cannot be resolved. Is there everything ok?',
];
yield [
stdClass::class,
true,
'Name of class from given \'string\' stdClass cannot be resolved. Is there everything ok?',
];
}
public function testConstructorVisibilityAndArguments(): void
{
static::assertConstructorVisibilityAndArguments(
@@ -34,14 +61,6 @@ class CannotResolveClassNameExceptionTest extends BaseTestCase
);
}
public function testCreateUsingDefaults(): void
{
$exception = CannotResolveClassNameException::create(stdClass::class);
$expectedMessage = 'Name of class from given \'string\' stdClass cannot be resolved. Is there everything ok?';
static::assertSame($expectedMessage, $exception->getMessage());
}
/**
* @param string $source Source of name of the class or trait
* @param bool $forClass (optional) If is set to true, message of this exception for class is prepared.
@@ -56,30 +75,11 @@ class CannotResolveClassNameExceptionTest extends BaseTestCase
static::assertSame($expectedMessage, $exception->getMessage());
}
/**
* Provides source of the class's / trait's name, information if message of this exception should be prepared for
* class and the expected exception's message
*
* @return Generator
*/
public function provideClassName(): Generator
public function testCreateUsingDefaults(): void
{
yield[
'Not\Existing\Class',
true,
'Name of class from given \'string\' Not\Existing\Class cannot be resolved. Is there everything ok?',
];
$exception = CannotResolveClassNameException::create(stdClass::class);
$expectedMessage = 'Name of class from given \'string\' stdClass cannot be resolved. Is there everything ok?';
yield[
'Not\Existing\Trait',
false,
'Name of trait from given \'string\' Not\Existing\Trait cannot be resolved. Is there everything ok?',
];
yield[
stdClass::class,
true,
'Name of class from given \'string\' stdClass cannot be resolved. Is there everything ok?',
];
static::assertSame($expectedMessage, $exception->getMessage());
}
}