class YamlFileLoaderTest in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php \Symfony\Component\Routing\Tests\Loader\YamlFileLoaderTest
- 8.0 vendor/symfony/translation/Tests/Loader/YamlFileLoaderTest.php \Symfony\Component\Translation\Tests\Loader\YamlFileLoaderTest
- 8.0 vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php \Symfony\Component\DependencyInjection\Tests\Loader\YamlFileLoaderTest
- 8.0 vendor/symfony/validator/Tests/Mapping/Loader/YamlFileLoaderTest.php \Symfony\Component\Validator\Tests\Mapping\Loader\YamlFileLoaderTest
- 8.0 vendor/symfony/serializer/Tests/Mapping/Loader/YamlFileLoaderTest.php \Symfony\Component\Serializer\Tests\Mapping\Loader\YamlFileLoaderTest
Same name and namespace in other branches
- 8 vendor/symfony/serializer/Tests/Mapping/Loader/YamlFileLoaderTest.php \Symfony\Component\Serializer\Tests\Mapping\Loader\YamlFileLoaderTest
@author Kévin Dunglas <dunglas@gmail.com>
Hierarchy
- class \Symfony\Component\Serializer\Tests\Mapping\Loader\YamlFileLoaderTest extends \Symfony\Component\Serializer\Tests\Mapping\Loader\PHPUnit_Framework_TestCase
Expanded class hierarchy of YamlFileLoaderTest
File
- vendor/
symfony/ serializer/ Tests/ Mapping/ Loader/ YamlFileLoaderTest.php, line 21
Namespace
Symfony\Component\Serializer\Tests\Mapping\LoaderView source
class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase {
/**
* @var YamlFileLoader
*/
private $loader;
/**
* @var ClassMetadata
*/
private $metadata;
protected function setUp() {
$this->loader = new YamlFileLoader(__DIR__ . '/../../Fixtures/serialization.yml');
$this->metadata = new ClassMetadata('Symfony\\Component\\Serializer\\Tests\\Fixtures\\GroupDummy');
}
public function testInterface() {
$this
->assertInstanceOf('Symfony\\Component\\Serializer\\Mapping\\Loader\\LoaderInterface', $this->loader);
}
public function testLoadClassMetadataReturnsTrueIfSuccessful() {
$this
->assertTrue($this->loader
->loadClassMetadata($this->metadata));
}
public function testLoadClassMetadataReturnsFalseWhenEmpty() {
$loader = new YamlFileLoader(__DIR__ . '/../../Fixtures/empty-mapping.yml');
$this
->assertFalse($loader
->loadClassMetadata($this->metadata));
}
/**
* @expectedException \Symfony\Component\Serializer\Exception\MappingException
*/
public function testLoadClassMetadataReturnsThrowsInvalidMapping() {
$loader = new YamlFileLoader(__DIR__ . '/../../Fixtures/invalid-mapping.yml');
$loader
->loadClassMetadata($this->metadata);
}
public function testLoadClassMetadata() {
$this->loader
->loadClassMetadata($this->metadata);
$this
->assertEquals(TestClassMetadataFactory::createXmlCLassMetadata(), $this->metadata);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
YamlFileLoaderTest:: |
private | property | ||
YamlFileLoaderTest:: |
private | property | ||
YamlFileLoaderTest:: |
protected | function | ||
YamlFileLoaderTest:: |
public | function | ||
YamlFileLoaderTest:: |
public | function | ||
YamlFileLoaderTest:: |
public | function | ||
YamlFileLoaderTest:: |
public | function | @expectedException \Symfony\Component\Serializer\Exception\MappingException | |
YamlFileLoaderTest:: |
public | function |