You are here

public function StaticMethodLoaderTest::testLoadClassMetadataDoesNotRepeatLoadWithParentClasses in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php, line 58

Class

StaticMethodLoaderTest

Namespace

Symfony\Component\Validator\Tests\Mapping\Loader

Code

public function testLoadClassMetadataDoesNotRepeatLoadWithParentClasses() {
  $loader = new StaticMethodLoader('loadMetadata');
  $metadata = new ClassMetadata(__NAMESPACE__ . '\\StaticLoaderDocument');
  $loader
    ->loadClassMetadata($metadata);
  $this
    ->assertCount(0, $metadata
    ->getConstraints());
  $loader = new StaticMethodLoader('loadMetadata');
  $metadata = new ClassMetadata(__NAMESPACE__ . '\\BaseStaticLoaderDocument');
  $loader
    ->loadClassMetadata($metadata);
  $this
    ->assertCount(1, $metadata
    ->getConstraints());
}