Commit b51769c1 authored by Fabien Potencier's avatar Fabien Potencier

minor #1278 fixes some routing deprecation notices (fabpot)

This PR was merged into the 1.3 branch.

Discussion
----------

fixes some routing deprecation notices

Commits
-------

28ff0034 fixes some routing deprecation notices
parents e6dd62a3 28ff0034
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use Silex\Provider\UrlGeneratorServiceProvider; use Silex\Provider\UrlGeneratorServiceProvider;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/** /**
* UrlGeneratorTrait test cases. * UrlGeneratorTrait test cases.
...@@ -26,7 +27,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase ...@@ -26,7 +27,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{ {
$app = $this->createApplication(); $app = $this->createApplication();
$app['url_generator'] = $translator = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->disableOriginalConstructor()->getMock(); $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'); $app->url('foo');
} }
...@@ -34,7 +35,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase ...@@ -34,7 +35,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{ {
$app = $this->createApplication(); $app = $this->createApplication();
$app['url_generator'] = $translator = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->disableOriginalConstructor()->getMock(); $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'); $app->path('foo');
} }
......
...@@ -14,6 +14,7 @@ namespace Silex\Tests\Provider; ...@@ -14,6 +14,7 @@ namespace Silex\Tests\Provider;
use Silex\Application; use Silex\Application;
use Silex\Provider\UrlGeneratorServiceProvider; use Silex\Provider\UrlGeneratorServiceProvider;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/** /**
* UrlGeneratorProvider test cases. * UrlGeneratorProvider test cases.
...@@ -68,7 +69,7 @@ class UrlGeneratorServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -68,7 +69,7 @@ class UrlGeneratorServiceProviderTest extends \PHPUnit_Framework_TestCase
->bind('hello'); ->bind('hello');
$app->get('/', function () use ($app) { $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/'); $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