a6cea9b980b0975f43e4b0eddfdaebd3c347ef8a
[yaffs-website] / vendor / symfony / serializer / Tests / Mapping / Loader / XmlFileLoaderTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Serializer\Tests\Mapping\Loader;
13
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;
18
19 /**
20  * @author Kévin Dunglas <dunglas@gmail.com>
21  */
22 class XmlFileLoaderTest extends TestCase
23 {
24     /**
25      * @var XmlFileLoader
26      */
27     private $loader;
28     /**
29      * @var ClassMetadata
30      */
31     private $metadata;
32
33     protected function setUp()
34     {
35         $this->loader = new XmlFileLoader(__DIR__.'/../../Fixtures/serialization.xml');
36         $this->metadata = new ClassMetadata('Symfony\Component\Serializer\Tests\Fixtures\GroupDummy');
37     }
38
39     public function testInterface()
40     {
41         $this->assertInstanceOf('Symfony\Component\Serializer\Mapping\Loader\LoaderInterface', $this->loader);
42     }
43
44     public function testLoadClassMetadataReturnsTrueIfSuccessful()
45     {
46         $this->assertTrue($this->loader->loadClassMetadata($this->metadata));
47     }
48
49     public function testLoadClassMetadata()
50     {
51         $this->loader->loadClassMetadata($this->metadata);
52
53         $this->assertEquals(TestClassMetadataFactory::createXmlCLassMetadata(), $this->metadata);
54     }
55 }