Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
@@ -84,12 +84,35 @@ class PhpGeneratorDumperTest extends TestCase
|
||||
$this->assertEquals('/app.php/testing2', $relativeUrlWithoutParameter);
|
||||
}
|
||||
|
||||
public function testDumpWithLocalizedRoutes()
|
||||
{
|
||||
$this->routeCollection->add('test.en', (new Route('/testing/is/fun'))->setDefault('_locale', 'en')->setDefault('_canonical_route', 'test'));
|
||||
$this->routeCollection->add('test.nl', (new Route('/testen/is/leuk'))->setDefault('_locale', 'nl')->setDefault('_canonical_route', 'test'));
|
||||
|
||||
$code = $this->generatorDumper->dump(array(
|
||||
'class' => 'LocalizedProjectUrlGenerator',
|
||||
));
|
||||
file_put_contents($this->testTmpFilepath, $code);
|
||||
include $this->testTmpFilepath;
|
||||
|
||||
$context = new RequestContext('/app.php');
|
||||
$projectUrlGenerator = new \LocalizedProjectUrlGenerator($context, null, 'en');
|
||||
|
||||
$urlWithDefaultLocale = $projectUrlGenerator->generate('test');
|
||||
$urlWithSpecifiedLocale = $projectUrlGenerator->generate('test', array('_locale' => 'nl'));
|
||||
$context->setParameter('_locale', 'en');
|
||||
$urlWithEnglishContext = $projectUrlGenerator->generate('test');
|
||||
$context->setParameter('_locale', 'nl');
|
||||
$urlWithDutchContext = $projectUrlGenerator->generate('test');
|
||||
|
||||
$this->assertEquals('/app.php/testing/is/fun', $urlWithDefaultLocale);
|
||||
$this->assertEquals('/app.php/testen/is/leuk', $urlWithSpecifiedLocale);
|
||||
$this->assertEquals('/app.php/testing/is/fun', $urlWithEnglishContext);
|
||||
$this->assertEquals('/app.php/testen/is/leuk', $urlWithDutchContext);
|
||||
}
|
||||
|
||||
public function testDumpWithTooManyRoutes()
|
||||
{
|
||||
if (\defined('HHVM_VERSION_ID')) {
|
||||
$this->markTestSkipped('HHVM consumes too much memory on this test.');
|
||||
}
|
||||
|
||||
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
|
||||
for ($i = 0; $i < 32769; ++$i) {
|
||||
$this->routeCollection->add('route_'.$i, new Route('/route_'.$i));
|
||||
|
Reference in New Issue
Block a user