Commit ec53f07e authored by Fabien Potencier's avatar Fabien Potencier

fixed tests for Symfony 2.6+

parent 288d8911
...@@ -72,7 +72,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -72,7 +72,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
$request = Request::create('/foo'); $request = Request::create('/foo');
$response = $app->handle($request); $response = $app->handle($request);
$this->assertContains('No route found for "GET /foo"', $response->getContent()); $this->assertContains('No route found for "GET /foo"', html_entity_decode($response->getContent()));
$this->assertEquals(404, $response->getStatusCode()); $this->assertEquals(404, $response->getStatusCode());
} }
...@@ -99,7 +99,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -99,7 +99,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
$request = Request::create('/foo', 'POST'); $request = Request::create('/foo', 'POST');
$response = $app->handle($request); $response = $app->handle($request);
$this->assertContains('No route found for "POST /foo": Method Not Allowed (Allow: GET)', $response->getContent()); $this->assertContains('No route found for "POST /foo": Method Not Allowed (Allow: GET)', html_entity_decode($response->getContent()));
$this->assertEquals(405, $response->getStatusCode()); $this->assertEquals(405, $response->getStatusCode());
$this->assertEquals('GET', $response->headers->get('Allow')); $this->assertEquals('GET', $response->headers->get('Allow'));
} }
......
...@@ -54,7 +54,7 @@ class SecurityServiceProviderTest extends WebTestCase ...@@ -54,7 +54,7 @@ class SecurityServiceProviderTest extends WebTestCase
$this->assertEquals('ANONYMOUS', $client->getResponse()->getContent()); $this->assertEquals('ANONYMOUS', $client->getResponse()->getContent());
$client->request('post', '/login_check', array('_username' => 'fabien', '_password' => 'bar')); $client->request('post', '/login_check', array('_username' => 'fabien', '_password' => 'bar'));
$this->assertEquals('Bad credentials', $app['security.last_error']($client->getRequest())); $this->assertContains('Bad credentials', $app['security.last_error']($client->getRequest()));
// hack to re-close the session as the previous assertions re-opens it // hack to re-close the session as the previous assertions re-opens it
$client->getRequest()->getSession()->save(); $client->getRequest()->getSession()->save();
......
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