Laravel version update
Laravel version update
This commit is contained in:
@@ -11,13 +11,14 @@
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Generator\Dumper;
|
||||
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Routing\Route;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
use Symfony\Component\Routing\Route;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
|
||||
class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class PhpGeneratorDumperTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var RouteCollection
|
||||
@@ -45,8 +46,8 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->routeCollection = new RouteCollection();
|
||||
$this->generatorDumper = new PhpGeneratorDumper($this->routeCollection);
|
||||
$this->testTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.php';
|
||||
$this->largeTestTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.large.php';
|
||||
$this->testTmpFilepath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.php';
|
||||
$this->largeTestTmpFilepath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.large.php';
|
||||
@unlink($this->testTmpFilepath);
|
||||
@unlink($this->largeTestTmpFilepath);
|
||||
}
|
||||
@@ -77,15 +78,15 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$relativeUrlWithParameter = $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH);
|
||||
$relativeUrlWithoutParameter = $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
|
||||
|
||||
$this->assertEquals($absoluteUrlWithParameter, 'http://localhost/app.php/testing/bar');
|
||||
$this->assertEquals($absoluteUrlWithoutParameter, 'http://localhost/app.php/testing2');
|
||||
$this->assertEquals($relativeUrlWithParameter, '/app.php/testing/bar');
|
||||
$this->assertEquals($relativeUrlWithoutParameter, '/app.php/testing2');
|
||||
$this->assertEquals('http://localhost/app.php/testing/bar', $absoluteUrlWithParameter);
|
||||
$this->assertEquals('http://localhost/app.php/testing2', $absoluteUrlWithoutParameter);
|
||||
$this->assertEquals('/app.php/testing/bar', $relativeUrlWithParameter);
|
||||
$this->assertEquals('/app.php/testing2', $relativeUrlWithoutParameter);
|
||||
}
|
||||
|
||||
public function testDumpWithTooManyRoutes()
|
||||
{
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
if (\defined('HHVM_VERSION_ID')) {
|
||||
$this->markTestSkipped('HHVM consumes too much memory on this test.');
|
||||
}
|
||||
|
||||
@@ -108,10 +109,10 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$relativeUrlWithParameter = $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH);
|
||||
$relativeUrlWithoutParameter = $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
|
||||
|
||||
$this->assertEquals($absoluteUrlWithParameter, 'http://localhost/app.php/testing/bar');
|
||||
$this->assertEquals($absoluteUrlWithoutParameter, 'http://localhost/app.php/testing2');
|
||||
$this->assertEquals($relativeUrlWithParameter, '/app.php/testing/bar');
|
||||
$this->assertEquals($relativeUrlWithoutParameter, '/app.php/testing2');
|
||||
$this->assertEquals('http://localhost/app.php/testing/bar', $absoluteUrlWithParameter);
|
||||
$this->assertEquals('http://localhost/app.php/testing2', $absoluteUrlWithoutParameter);
|
||||
$this->assertEquals('/app.php/testing/bar', $relativeUrlWithParameter);
|
||||
$this->assertEquals('/app.php/testing2', $relativeUrlWithoutParameter);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,7 +152,7 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$projectUrlGenerator = new \DefaultRoutesUrlGenerator(new RequestContext());
|
||||
$url = $projectUrlGenerator->generate('Test', array());
|
||||
|
||||
$this->assertEquals($url, '/testing');
|
||||
$this->assertEquals('/testing', $url);
|
||||
}
|
||||
|
||||
public function testDumpWithSchemeRequirement()
|
||||
@@ -166,15 +167,15 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$absoluteUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$relativeUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
|
||||
|
||||
$this->assertEquals($absoluteUrl, 'ftp://localhost/app.php/testing');
|
||||
$this->assertEquals($relativeUrl, 'ftp://localhost/app.php/testing');
|
||||
$this->assertEquals('ftp://localhost/app.php/testing', $absoluteUrl);
|
||||
$this->assertEquals('ftp://localhost/app.php/testing', $relativeUrl);
|
||||
|
||||
$projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php', 'GET', 'localhost', 'https'));
|
||||
|
||||
$absoluteUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$relativeUrl = $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
|
||||
|
||||
$this->assertEquals($absoluteUrl, 'https://localhost/app.php/testing');
|
||||
$this->assertEquals($relativeUrl, '/app.php/testing');
|
||||
$this->assertEquals('https://localhost/app.php/testing', $absoluteUrl);
|
||||
$this->assertEquals('/app.php/testing', $relativeUrl);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user