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

@@ -8,9 +8,11 @@
namespace Meritoo\Test\Common\Exception\Reflection;
use Generator;
use Meritoo\Common\Exception\Reflection\NotExistingPropertyException;
use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Type\OopVisibilityType;
use stdClass;
/**
* Class NotExistingPropertyExceptionTest
@@ -23,6 +25,39 @@ use Meritoo\Common\Type\OopVisibilityType;
*/
class NotExistingPropertyExceptionTest extends BaseTestCase
{
public function provideObjectPropertyAndMessage(): ?Generator
{
$template = 'Property \'%s\' does not exist in instance of class \'%s\'. Did you use proper name of property?';
yield [
'An empty string as name of property',
new stdClass(),
'',
sprintf($template, '', get_class(new stdClass())),
];
yield [
'Null as name of property',
new stdClass(),
null,
sprintf($template, '', get_class(new stdClass())),
];
yield [
'String with spaces as name of property',
new stdClass(),
'This is test',
sprintf($template, 'This is test', get_class(new stdClass())),
];
yield [
'String without spaces as name of property',
new stdClass(),
'ThisIsTest',
sprintf($template, 'ThisIsTest', get_class(new stdClass())),
];
}
public function testConstructor(): void
{
static::assertConstructorVisibilityAndArguments(
@@ -45,37 +80,4 @@ class NotExistingPropertyExceptionTest extends BaseTestCase
$exception = NotExistingPropertyException::create($object, $property);
static::assertSame($expectedMessage, $exception->getMessage(), $description);
}
public function provideObjectPropertyAndMessage(): ?\Generator
{
$template = 'Property \'%s\' does not exist in instance of class \'%s\'. Did you use proper name of property?';
yield[
'An empty string as name of property',
new \stdClass(),
'',
sprintf($template, '', get_class(new \stdClass())),
];
yield[
'Null as name of property',
new \stdClass(),
null,
sprintf($template, '', get_class(new \stdClass())),
];
yield[
'String with spaces as name of property',
new \stdClass(),
'This is test',
sprintf($template, 'This is test', get_class(new \stdClass())),
];
yield[
'String without spaces as name of property',
new \stdClass(),
'ThisIsTest',
sprintf($template, 'ThisIsTest', get_class(new \stdClass())),
];
}
}