Skip to content

Commit 0e610a8

Browse files
minor symfony#59528 [PropertyInfo] Add missing test (HypeMC)
This PR was merged into the 6.4 branch. Discussion ---------- [PropertyInfo] Add missing test | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Currently, this case isn't covered by a tests. Commits ------- e444e5b [PropertyInfo] Add missing test
2 parents 9c3757f + e444e5b commit 0e610a8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,17 @@ public static function writeMutatorProvider(): array
631631
];
632632
}
633633

634+
public function testDisabledAdderAndRemoverReturnsError()
635+
{
636+
$writeMutator = $this->extractor->getWriteInfo(Php71Dummy::class, 'baz', [
637+
'enable_adder_remover_extraction' => false,
638+
]);
639+
640+
self::assertNotNull($writeMutator);
641+
self::assertSame(PropertyWriteInfo::TYPE_NONE, $writeMutator->getType());
642+
self::assertSame([\sprintf('The property "baz" in class "%s" can be defined with the methods "addBaz()", "removeBaz()" but the new value must be an array or an instance of \Traversable', Php71Dummy::class)], $writeMutator->getErrors());
643+
}
644+
634645
public function testGetWriteInfoReadonlyProperties()
635646
{
636647
$writeMutatorConstructor = $this->extractor->getWriteInfo(Php81Dummy::class, 'foo', ['enable_constructor_extraction' => true]);

0 commit comments

Comments
 (0)