Skip to content

Commit

Permalink
Use ProphecyTrait to fix warnings
Browse files Browse the repository at this point in the history
In PHPUnit 9, Prophecy integration was deprecated, see sebastianbergmann/phpunit#4141.
phpspec/prophecy-phpunit was added to support prophecy calls.
  • Loading branch information
franmomu committed Sep 18, 2020
1 parent 19ae9a8 commit 8893e33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"phpspec/prophecy-phpunit": "^2.0",
"sonata-project/admin-bundle": "^3.31",
"sonata-project/media-bundle": "^3.10",
"symfony/phpunit-bridge": "^5.1"
Expand Down
3 changes: 3 additions & 0 deletions tests/Controller/CkeditorAdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Sonata\AdminBundle\Admin\Pool as AdminPool;
use Sonata\AdminBundle\Datagrid\DatagridInterface;
use Sonata\AdminBundle\Templating\TemplateRegistry;
Expand Down Expand Up @@ -48,6 +49,8 @@ public function getId()

class CkeditorAdminControllerTest extends TestCase
{
use ProphecyTrait;

private $container;
private $admin;
private $request;
Expand Down
3 changes: 3 additions & 0 deletions tests/Twig/Loader/LoaderSelectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
namespace Sonata\FormatterBundle\Tests\Twig\Loader;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Sonata\FormatterBundle\Twig\Loader\LoaderSelector;
use Twig\Loader\LoaderInterface;

class LoaderSelectorTest extends TestCase
{
use ProphecyTrait;

public function testCanBeInstanciated(): void
{
$loaderSelector = new LoaderSelector(
Expand Down

0 comments on commit 8893e33

Please sign in to comment.