Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
fixes some routing deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Nov 4, 2015
1 parent e6dd62a commit 28ff003
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
Expand Up @@ -12,6 +12,7 @@
namespace Silex\Tests\Application;

use Silex\Provider\UrlGeneratorServiceProvider;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

/**
* UrlGeneratorTrait test cases.
Expand All @@ -26,15 +27,15 @@ public function testUrl()
{
$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');
}

public function testPath()
{
$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');
}

Expand Down
Expand Up @@ -14,6 +14,7 @@
use Silex\Application;
use Silex\Provider\UrlGeneratorServiceProvider;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

/**
* UrlGeneratorProvider test cases.
Expand Down Expand Up @@ -68,7 +69,7 @@ public function testAbsoluteUrlGeneration()
->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/');
Expand Down

0 comments on commit 28ff003

Please sign in to comment.