You are here

class AnnotationLoaderTest in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Tests/Mapping/Loader/AnnotationLoaderTest.php \Symfony\Component\Validator\Tests\Mapping\Loader\AnnotationLoaderTest
  2. 8 vendor/symfony/serializer/Tests/Mapping/Loader/AnnotationLoaderTest.php \Symfony\Component\Serializer\Tests\Mapping\Loader\AnnotationLoaderTest
Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Tests/Mapping/Loader/AnnotationLoaderTest.php \Symfony\Component\Serializer\Tests\Mapping\Loader\AnnotationLoaderTest

@author Kévin Dunglas <dunglas@gmail.com>

Hierarchy

  • class \Symfony\Component\Serializer\Tests\Mapping\Loader\AnnotationLoaderTest extends \Symfony\Component\Serializer\Tests\Mapping\Loader\PHPUnit_Framework_TestCase

Expanded class hierarchy of AnnotationLoaderTest

File

vendor/symfony/serializer/Tests/Mapping/Loader/AnnotationLoaderTest.php, line 22

Namespace

Symfony\Component\Serializer\Tests\Mapping\Loader
View source
class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase {

  /**
   * @var AnnotationLoader
   */
  private $loader;
  protected function setUp() {
    $this->loader = new AnnotationLoader(new AnnotationReader());
  }
  public function testInterface() {
    $this
      ->assertInstanceOf('Symfony\\Component\\Serializer\\Mapping\\Loader\\LoaderInterface', $this->loader);
  }
  public function testLoadClassMetadataReturnsTrueIfSuccessful() {
    $classMetadata = new ClassMetadata('Symfony\\Component\\Serializer\\Tests\\Fixtures\\GroupDummy');
    $this
      ->assertTrue($this->loader
      ->loadClassMetadata($classMetadata));
  }
  public function testLoadClassMetadata() {
    $classMetadata = new ClassMetadata('Symfony\\Component\\Serializer\\Tests\\Fixtures\\GroupDummy');
    $this->loader
      ->loadClassMetadata($classMetadata);
    $this
      ->assertEquals(TestClassMetadataFactory::createClassMetadata(), $classMetadata);
  }
  public function testLoadClassMetadataAndMerge() {
    $classMetadata = new ClassMetadata('Symfony\\Component\\Serializer\\Tests\\Fixtures\\GroupDummy');
    $parentClassMetadata = new ClassMetadata('Symfony\\Component\\Serializer\\Tests\\Fixtures\\GroupDummyParent');
    $this->loader
      ->loadClassMetadata($parentClassMetadata);
    $classMetadata
      ->merge($parentClassMetadata);
    $this->loader
      ->loadClassMetadata($classMetadata);
    $this
      ->assertEquals(TestClassMetadataFactory::createClassMetadata(true), $classMetadata);
  }

}

Members