Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van den Nieuwenhuisen committed Jul 24, 2020
1 parent 5a4528c commit 3fcc75a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/Controller/CRUDControllerTest.php
Expand Up @@ -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;
Expand Down Expand Up @@ -74,6 +75,10 @@
*/
class CRUDControllerTest extends TestCase
{
use ExpectDeprecationTrait {
expectDeprecation as traitExpectDeprecation;
}

/**
* @var CRUDController
*/
Expand Down Expand Up @@ -1665,10 +1670,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->traitExpectDeprecation('In next major version response will return 406 NOT ACCEPTABLE without `Accept: application/json` or `Accept: */*`');

$object = new \stdClass();

$this->admin->expects($this->once())
Expand Down Expand Up @@ -2363,10 +2369,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->traitExpectDeprecation('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'))
Expand Down

0 comments on commit 3fcc75a

Please sign in to comment.