[Routing] Reorder assert parameters

This commit is contained in:
Guilhem N 2016-08-06 17:00:05 +02:00 committed by GitHub
parent aae8e3da57
commit 7f8879686c

View File

@ -77,10 +77,10 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
$relativeUrlWithParameter = $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH); $relativeUrlWithParameter = $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH);
$relativeUrlWithoutParameter = $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH); $relativeUrlWithoutParameter = $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
$this->assertEquals($absoluteUrlWithParameter, 'http://localhost/app.php/testing/bar'); $this->assertEquals('http://localhost/app.php/testing/bar', $absoluteUrlWithParameter);
$this->assertEquals($absoluteUrlWithoutParameter, 'http://localhost/app.php/testing2'); $this->assertEquals('http://localhost/app.php/testing2', $absoluteUrlWithoutParameter);
$this->assertEquals($relativeUrlWithParameter, '/app.php/testing/bar'); $this->assertEquals('/app.php/testing/bar', $relativeUrlWithParameter);
$this->assertEquals($relativeUrlWithoutParameter, '/app.php/testing2'); $this->assertEquals('/app.php/testing2', $relativeUrlWithoutParameter);
} }
public function testDumpWithTooManyRoutes() public function testDumpWithTooManyRoutes()
@ -108,10 +108,10 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
$relativeUrlWithParameter = $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH); $relativeUrlWithParameter = $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH);
$relativeUrlWithoutParameter = $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH); $relativeUrlWithoutParameter = $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
$this->assertEquals($absoluteUrlWithParameter, 'http://localhost/app.php/testing/bar'); $this->assertEquals('http://localhost/app.php/testing/bar', $absoluteUrlWithParameter);
$this->assertEquals($absoluteUrlWithoutParameter, 'http://localhost/app.php/testing2'); $this->assertEquals('http://localhost/app.php/testing2', $absoluteUrlWithoutParameter);
$this->assertEquals($relativeUrlWithParameter, '/app.php/testing/bar'); $this->assertEquals('/app.php/testing/bar', $relativeUrlWithParameter);
$this->assertEquals($relativeUrlWithoutParameter, '/app.php/testing2'); $this->assertEquals('/app.php/testing2', $relativeUrlWithoutParameter);
} }
/** /**
@ -151,7 +151,7 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
$projectUrlGenerator = new \DefaultRoutesUrlGenerator(new RequestContext()); $projectUrlGenerator = new \DefaultRoutesUrlGenerator(new RequestContext());
$url = $projectUrlGenerator->generate('Test', array()); $url = $projectUrlGenerator->generate('Test', array());
$this->assertEquals($url, '/testing'); $this->assertEquals('/testing', $url);
} }
public function testDumpWithSchemeRequirement() public function testDumpWithSchemeRequirement()
@ -166,15 +166,15 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
$absoluteUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL); $absoluteUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL);
$relativeUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH); $relativeUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
$this->assertEquals($absoluteUrl, 'ftp://localhost/app.php/testing'); $this->assertEquals('ftp://localhost/app.php/testing', $absoluteUrl);
$this->assertEquals($relativeUrl, 'ftp://localhost/app.php/testing'); $this->assertEquals('ftp://localhost/app.php/testing', $relativeUrl);
$projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php', 'GET', 'localhost', 'https')); $projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php', 'GET', 'localhost', 'https'));
$absoluteUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL); $absoluteUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL);
$relativeUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH); $relativeUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
$this->assertEquals($absoluteUrl, 'https://localhost/app.php/testing'); $this->assertEquals('https://localhost/app.php/testing', $absoluteUrl);
$this->assertEquals($relativeUrl, '/app.php/testing'); $this->assertEquals('/app.php/testing', $relativeUrl);
} }
} }