Commit 28ff0034 authored by Fabien Potencier's avatar Fabien Potencier

fixes some routing deprecation notices

parent e6dd62a3
......@@ -12,6 +12,7 @@
namespace Silex\Tests\Application;
use Silex\Provider\UrlGeneratorServiceProvider;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* UrlGeneratorTrait test cases.
......@@ -26,7 +27,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
$app = $this->createApplication();
$app['url_generator'] = $translator = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->disableOriginalConstructor()->getMock();
$translator->expects($this->once())->method('generate')->with('foo', array(), true);
$translator->expects($this->once())->method('generate')->with('foo', array(), UrlGeneratorInterface::ABSOLUTE_URL);
$app->url('foo');
}
......@@ -34,7 +35,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
$app = $this->createApplication();
$app['url_generator'] = $translator = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->disableOriginalConstructor()->getMock();
$translator->expects($this->once())->method('generate')->with('foo', array(), false);
$translator->expects($this->once())->method('generate')->with('foo', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
$app->path('foo');
}
......
......@@ -14,6 +14,7 @@ namespace Silex\Tests\Provider;
use Silex\Application;
use Silex\Provider\UrlGeneratorServiceProvider;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* UrlGeneratorProvider test cases.
......@@ -68,7 +69,7 @@ class UrlGeneratorServiceProviderTest extends \PHPUnit_Framework_TestCase
->bind('hello');
$app->get('/', function () use ($app) {
return $app['url_generator']->generate('hello', array('name' => 'john'), true);
return $app['url_generator']->generate('hello', array('name' => 'john'), UrlGeneratorInterface::ABSOLUTE_URL);
});
$request = Request::create('https://localhost:81/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment