Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function testClassNoAutoMapping()

/** @var PropertyMetadata[] $autoMappingExplicitlyEnabledMetadata */
$autoMappingExplicitlyEnabledMetadata = $classMetadata->getPropertyMetadata('autoMappingExplicitlyEnabled');
$this->assertCount(1, $autoMappingExplicitlyEnabledMetadata[0]->constraints);
$this->assertCount(1, $autoMappingExplicitlyEnabledMetadata[0]->getConstraints());
$this->assertSame(AutoMappingStrategy::ENABLED, $autoMappingExplicitlyEnabledMetadata[0]->getAutoMappingStrategy());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function test2Dot5ValidationApi()
$this->assertCount(1, $metadata->getConstraints());
$this->assertInstanceOf(FormConstraint::class, $metadata->getConstraints()[0]);

$this->assertSame(CascadingStrategy::NONE, $metadata->cascadingStrategy);
$this->assertSame(TraversalStrategy::NONE, $metadata->traversalStrategy);
$this->assertSame(CascadingStrategy::NONE, $metadata->getCascadingStrategy());
$this->assertSame(TraversalStrategy::NONE, $metadata->getTraversalStrategy());
$this->assertCount(0, $metadata->getPropertyMetadata('children'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ public static function provideServiceValidatedConstraints(): iterable
$metadata = new ClassMetadata(UserPasswordDummy::class);
self::assertTrue((new AttributeLoader())->loadClassMetadata($metadata));

yield 'attribute' => [$metadata->properties['b']->constraints[0]];
yield 'attribute' => [$metadata->getPropertyMetadata('b')[0]->getConstraints()[0]];
}

public function testAttributes()
{
$metadata = new ClassMetadata(UserPasswordDummy::class);
self::assertTrue((new AttributeLoader())->loadClassMetadata($metadata));

[$bConstraint] = $metadata->properties['b']->getConstraints();
[$bConstraint] = $metadata->getPropertyMetadata('b')[0]->getConstraints();
self::assertSame('myMessage', $bConstraint->message);
self::assertSame(['Default', 'UserPasswordDummy'], $bConstraint->groups);
self::assertNull($bConstraint->payload);

[$cConstraint] = $metadata->properties['c']->getConstraints();
[$cConstraint] = $metadata->getPropertyMetadata('c')[0]->getConstraints();
self::assertSame(['my_group'], $cConstraint->groups);
self::assertSame('some attached data', $cConstraint->payload);
}
Expand Down
Loading