4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Serializer\Tests\Mapping\Loader;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
16 use Symfony\Component\Serializer\Mapping\ClassMetadata;
17 use Symfony\Component\Serializer\Tests\Mapping\TestClassMetadataFactory;
20 * @author Kévin Dunglas <dunglas@gmail.com>
22 class XmlFileLoaderTest extends TestCase
33 protected function setUp()
35 $this->loader = new XmlFileLoader(__DIR__.'/../../Fixtures/serialization.xml');
36 $this->metadata = new ClassMetadata('Symfony\Component\Serializer\Tests\Fixtures\GroupDummy');
39 public function testInterface()
41 $this->assertInstanceOf('Symfony\Component\Serializer\Mapping\Loader\LoaderInterface', $this->loader);
44 public function testLoadClassMetadataReturnsTrueIfSuccessful()
46 $this->assertTrue($this->loader->loadClassMetadata($this->metadata));
49 public function testLoadClassMetadata()
51 $this->loader->loadClassMetadata($this->metadata);
53 $this->assertEquals(TestClassMetadataFactory::createXmlCLassMetadata(), $this->metadata);