From 19e79917a2bcaecf2d336e4d0f44b8bb56ab0b00 Mon Sep 17 00:00:00 2001 From: Jeroen van den Nieuwenhuisen Date: Fri, 24 Jul 2020 09:16:32 +0200 Subject: [PATCH] Fix tests --- tests/Controller/CRUDControllerTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Controller/CRUDControllerTest.php b/tests/Controller/CRUDControllerTest.php index 279d6e3befc..83809f13d44 100644 --- a/tests/Controller/CRUDControllerTest.php +++ b/tests/Controller/CRUDControllerTest.php @@ -40,6 +40,7 @@ use Sonata\Exporter\Exporter; use Sonata\Exporter\Source\SourceIteratorInterface; use Sonata\Exporter\Writer\JsonWriter; +use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine; use Symfony\Component\DependencyInjection\Container; @@ -74,6 +75,8 @@ */ class CRUDControllerTest extends TestCase { + use ExpectDeprecationTrait; + /** * @var CRUDController */ @@ -1665,10 +1668,11 @@ public function testEditActionAjaxError(): void /** * @legacy - * @expectedDeprecation In next major version response will return 406 NOT ACCEPTABLE without `Accept: application/json` */ public function testEditActionAjaxErrorWithoutAcceptApplicationJson(): void { + $this->expectDeprecation('In next major version response will return 406 NOT ACCEPTABLE without `Accept: application/json` or `Accept: */*`'); + $object = new \stdClass(); $this->admin->expects($this->once()) @@ -2363,10 +2367,11 @@ public function testCreateActionAjaxError(): void /** * @legacy - * @expectedDeprecation In next major version response will return 406 NOT ACCEPTABLE without `Accept: application/json` */ public function testCreateActionAjaxErrorWithoutAcceptApplicationJson(): void { + $this->expectDeprecation('In next major version response will return 406 NOT ACCEPTABLE without `Accept: application/json` or `Accept: */*`'); + $this->admin->expects($this->once()) ->method('checkAccess') ->with($this->equalTo('create'))