composer update

This commit is contained in:
2019-07-02 01:51:56 +00:00
parent b4a728213d
commit ebb41422f3
616 changed files with 14708 additions and 612 deletions

View File

@@ -600,28 +600,27 @@ class UrlGeneratorTest extends TestCase
public function testDefaultHostIsUsedWhenContextHostIsEmpty()
{
$routes = $this->getRoutes('test', new Route('/route', ['domain' => 'my.fallback.host'], ['domain' => '.+'], [], '{domain}', ['http']));
$routes = $this->getRoutes('test', new Route('/path', ['domain' => 'my.fallback.host'], ['domain' => '.+'], [], '{domain}'));
$generator = $this->getGenerator($routes);
$generator->getContext()->setHost('');
$this->assertSame('http://my.fallback.host/app.php/route', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_URL));
$this->assertSame('http://my.fallback.host/app.php/path', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_URL));
}
public function testDefaultHostIsUsedWhenContextHostIsEmptyAndSchemeIsNot()
public function testDefaultHostIsUsedWhenContextHostIsEmptyAndPathReferenceType()
{
$routes = $this->getRoutes('test', new Route('/route', ['domain' => 'my.fallback.host'], ['domain' => '.+'], [], '{domain}', ['http', 'https']));
$routes = $this->getRoutes('test', new Route('/path', ['domain' => 'my.fallback.host'], ['domain' => '.+'], [], '{domain}'));
$generator = $this->getGenerator($routes);
$generator->getContext()->setHost('');
$generator->getContext()->setScheme('https');
$this->assertSame('https://my.fallback.host/app.php/route', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_URL));
$this->assertSame('//my.fallback.host/app.php/path', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_PATH));
}
public function testAbsoluteUrlFallbackToRelativeIfHostIsEmptyAndSchemeIsNot()
public function testAbsoluteUrlFallbackToPathIfHostIsEmptyAndSchemeIsHttp()
{
$routes = $this->getRoutes('test', new Route('/route', [], [], [], '', ['http', 'https']));
$routes = $this->getRoutes('test', new Route('/route'));
$generator = $this->getGenerator($routes);
$generator->getContext()->setHost('');
@@ -630,6 +629,39 @@ class UrlGeneratorTest extends TestCase
$this->assertSame('/app.php/route', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_URL));
}
public function testAbsoluteUrlFallbackToNetworkIfSchemeIsEmptyAndHostIsNot()
{
$routes = $this->getRoutes('test', new Route('/path'));
$generator = $this->getGenerator($routes);
$generator->getContext()->setHost('example.com');
$generator->getContext()->setScheme('');
$this->assertSame('//example.com/app.php/path', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_URL));
}
public function testAbsoluteUrlFallbackToPathIfSchemeAndHostAreEmpty()
{
$routes = $this->getRoutes('test', new Route('/path'));
$generator = $this->getGenerator($routes);
$generator->getContext()->setHost('');
$generator->getContext()->setScheme('');
$this->assertSame('/app.php/path', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_URL));
}
public function testAbsoluteUrlWithNonHttpSchemeAndEmptyHost()
{
$routes = $this->getRoutes('test', new Route('/path', [], [], [], '', ['file']));
$generator = $this->getGenerator($routes);
$generator->getContext()->setBaseUrl('');
$generator->getContext()->setHost('');
$this->assertSame('file:///path', $generator->generate('test', [], UrlGeneratorInterface::ABSOLUTE_URL));
}
public function testGenerateNetworkPath()
{
$routes = $this->getRoutes('test', new Route('/{name}', [], [], [], '{locale}.example.com', ['http']));