You are here

public function XmlFileLoaderTest::testNullValues in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php \Symfony\Component\Routing\Tests\Loader\XmlFileLoaderTest::testNullValues()

File

vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php, line 139

Class

XmlFileLoaderTest

Namespace

Symfony\Component\Routing\Tests\Loader

Code

public function testNullValues() {
  $loader = new XmlFileLoader(new FileLocator(array(
    __DIR__ . '/../Fixtures',
  )));
  $routeCollection = $loader
    ->load('null_values.xml');
  $route = $routeCollection
    ->get('blog_show');
  $this
    ->assertTrue($route
    ->hasDefault('foo'));
  $this
    ->assertNull($route
    ->getDefault('foo'));
  $this
    ->assertTrue($route
    ->hasDefault('bar'));
  $this
    ->assertNull($route
    ->getDefault('bar'));
  $this
    ->assertEquals('foo', $route
    ->getDefault('foobar'));
  $this
    ->assertEquals('bar', $route
    ->getDefault('baz'));
}