Link header should provide fully qualified URIs

This commit is contained in:
Romain Neutron
2013-07-09 18:30:54 +02:00
parent 5c033caed3
commit 435b4b1644
3 changed files with 12 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Client;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface;
use Symfony\Component\Routing\RequestContext;
abstract class PhraseanetPHPUnitAbstract extends WebTestCase
{
@@ -118,6 +119,13 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
return new CsrfTestProvider();
});
$app['url_generator'] = $app->share($app->extend('url_generator', function($generator, $app) {
$host = parse_url($app['phraseanet.configuration']['main']['servername'], PHP_URL_HOST);
$generator->setContext(new RequestContext('', 'GET', $host));
return $generator;
}));
$app['debug'] = true;
$app['EM'] = $app->share($app->extend('EM', function($em) {