mirror of
https://github.com/doctrine/persistence.git
synced 2026-03-23 22:42:11 +01:00
Use Rector on tests
This is the configuration I used: <?php declare(strict_types=1); use Rector\Config\RectorConfig; return RectorConfig::configure() ->withPaths([ __DIR__ . '/tests', ]) ->withPhpSets();
This commit is contained in:
@@ -134,8 +134,8 @@ class TestAbstractClassMetadataFactory extends AbstractClassMetadataFactory
|
||||
|
||||
/** @param ClassMetadata<object>|null $defaultMetadata */
|
||||
public function __construct(
|
||||
private MappingDriver|null $driver = null,
|
||||
private ClassMetadata|null $defaultMetadata = null,
|
||||
private readonly MappingDriver|null $driver = null,
|
||||
private readonly ClassMetadata|null $defaultMetadata = null,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,11 @@ class RuntimeReflectionServiceTest extends TestCase
|
||||
|
||||
public mixed $unusedPublicProperty;
|
||||
|
||||
private string $typedNoDefaultProperty;
|
||||
/** @phpstan-ignore property.uninitializedReadonly */
|
||||
private readonly string $typedNoDefaultProperty;
|
||||
private string $typedDefaultProperty = '';
|
||||
private string $nonTypedNoDefaultProperty; // phpcs:ignore SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty
|
||||
/** @phpstan-ignore property.uninitializedReadonly */
|
||||
private readonly string $nonTypedNoDefaultProperty; // phpcs:ignore SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty
|
||||
private string $nonTypedDefaultProperty = ''; // phpcs:ignore SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty
|
||||
|
||||
public string $typedNoDefaultPublicProperty;
|
||||
|
||||
@@ -72,7 +72,7 @@ class TypedFoo
|
||||
|
||||
class TypedNullableFoo
|
||||
{
|
||||
private string|null $value;
|
||||
private string|null $value = null;
|
||||
|
||||
public function setValue(mixed $value): void
|
||||
{
|
||||
|
||||
@@ -39,8 +39,8 @@ class RuntimeReflectionPropertyTest extends TestCase
|
||||
}
|
||||
|
||||
/** @param class-string<RuntimeReflectionPropertyTestProxyMock> $proxyClass */
|
||||
#[TestWith(['Doctrine\\Tests\\Persistence\\RuntimeReflectionPropertyTestProxyMock'])]
|
||||
#[TestWith(['\\Doctrine\\Tests\\Persistence\\RuntimeReflectionPropertyTestProxyMock'])]
|
||||
#[TestWith([RuntimeReflectionPropertyTestProxyMock::class])]
|
||||
#[TestWith([RuntimeReflectionPropertyTestProxyMock::class])]
|
||||
public function testGetValueOnProxyProperty(string $proxyClass): void
|
||||
{
|
||||
$getCheckMock = $this->createMock(DummyMock::class);
|
||||
|
||||
Reference in New Issue
Block a user