File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1212namespace FOS \RestBundle \Tests \Functional ;
1313
1414use Symfony \Component \HttpFoundation \File \UploadedFile ;
15+ use Symfony \Component \HttpKernel \Exception \BadRequestHttpException ;
1516
1617/**
1718 * @author Ener-Getick <[email protected] > @@ -169,13 +170,18 @@ public function testValidQueryParameter()
169170 $ this ->client ->request ('POST ' , '/params?foz=val1 ' );
170171 }
171172
172- /**
173- * @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
174- * @expectedExceptionMessage 'baz' param is incompatible with foz param.
175- */
176173 public function testIncompatibleQueryParameter ()
177174 {
178- $ this ->client ->request ('POST ' , '/params?foz=val1&baz=val2 ' );
175+ try {
176+ $ this ->client ->request ('POST ' , '/params?foz=val1&baz=val2 ' );
177+
178+ // SF >= 3.0
179+ $ this ->assertEquals (400 , $ this ->client ->getResponse ()->getStatusCode ());
180+ $ this ->assertContains ("'baz' param is incompatible with foz param. " , $ this ->client ->getResponse ()->getContent ());
181+ } catch (BadRequestHttpException $ e ) {
182+ // SF 2.x
183+ $ this ->assertEquals ("'baz' param is incompatible with foz param. " , $ e ->getMessage ());
184+ }
179185 }
180186
181187 protected function getData ()
Original file line number Diff line number Diff line change 4747 },
4848 "require-dev" : {
4949 "sensio/framework-extra-bundle" : " ^3.0.13|^4.0|^5.0" ,
50- "symfony/phpunit-bridge" : " ^3.2|^ 4.0" ,
50+ "symfony/phpunit-bridge" : " ^4.0" ,
5151 "symfony/asset" : " ^2.7|^3.0|^4.0" ,
5252 "symfony/form" : " ^2.7|^3.0|^4.0" ,
5353 "symfony/validator" : " ^2.7|^3.0|^4.0" ,
5757 "symfony/web-profiler-bundle" : " ^2.7|^3.0|^4.0" ,
5858 "symfony/twig-bundle" : " ^2.7|^3.0|^4.0" ,
5959 "symfony/browser-kit" : " ^2.7|^3.0|^4.0" ,
60- "symfony/dependency-injection" : " ^2.7|^3.0|^4.0" ,
60+ "symfony/dependency-injection" : " ^2.7.20 |^3.0|^4.0" ,
6161 "symfony/expression-language" : " ~2.7|^3.0|^4.0" ,
6262 "symfony/css-selector" : " ^2.7|^3.0|^4.0" ,
6363 "phpoption/phpoption" : " ^1.1" ,
You can’t perform that action at this time.
0 commit comments