Commit 32bed6d4 authored by Fabien Potencier's avatar Fabien Potencier

Merge branch '1.3'

* 1.3:
  fixes some routing deprecation notices
  Fix comment about symfony version
parents f59fa3e7 b51769c1
......@@ -32,7 +32,7 @@ trait FormTrait
public function form($data = null, array $options = array(), $type = null)
{
if (null === $type) {
// for BC with Symfony pre 2.7
// BC with Symfony < 2.8
$type = class_exists('Symfony\Component\Form\Extension\Core\Type\RangeType') ? 'Symfony\Component\Form\Extension\Core\Type\FormType' : 'form';
}
......
......@@ -11,6 +11,8 @@
namespace Silex\Tests\Application;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* UrlGeneratorTrait test cases.
*
......@@ -22,7 +24,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
$app = new UrlGeneratorApplication();
$app['url_generator'] = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->disableOriginalConstructor()->getMock();
$app['url_generator']->expects($this->once())->method('generate')->with('foo', array(), true);
$app['url_generator']->expects($this->once())->method('generate')->with('foo', array(), UrlGeneratorInterface::ABSOLUTE_URL);
$app->url('foo');
}
......@@ -30,7 +32,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
$app = new UrlGeneratorApplication();
$app['url_generator'] = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->disableOriginalConstructor()->getMock();
$app['url_generator']->expects($this->once())->method('generate')->with('foo', array(), false);
$app['url_generator']->expects($this->once())->method('generate')->with('foo', array(), UrlGeneratorInterface::ABSOLUTE_PATH);
$app->path('foo');
}
}
......@@ -13,6 +13,7 @@ namespace Silex\Tests\Provider;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* RoutingProvider test cases.
......@@ -61,7 +62,7 @@ class RoutingServiceProviderTest 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