diff --git a/tests/Action/SearchActionTest.php b/tests/Action/SearchActionTest.php index 7a7ee2c260..e733a9abf4 100644 --- a/tests/Action/SearchActionTest.php +++ b/tests/Action/SearchActionTest.php @@ -13,6 +13,7 @@ namespace Sonata\AdminBundle\Tests\Action; +use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Sonata\AdminBundle\Action\SearchAction; use Sonata\AdminBundle\Admin\BreadcrumbsBuilderInterface; @@ -26,13 +27,36 @@ use Symfony\Component\HttpFoundation\Response; use Twig\Environment; -class SearchActionTest extends TestCase +final class SearchActionTest extends TestCase { + /** + * @var Container + */ private $container; + + /** + * @var Pool + */ private $pool; + + /** + * @var SearchHandler + */ private $searchHandler; + + /** + * @var SearchAction + */ private $action; + + /** + * @var Stub&Environment + */ private $twig; + + /** + * @var Stub&BreadcrumbsBuilderInterface + */ private $breadcrumbsBuilder; protected function setUp(): void @@ -45,7 +69,7 @@ protected function setUp(): void 'layout' => 'layout.html.twig', ]); - $this->breadcrumbsBuilder = $this->createMock(BreadcrumbsBuilderInterface::class); + $this->breadcrumbsBuilder = $this->createStub(BreadcrumbsBuilderInterface::class); $this->searchHandler = new SearchHandler(true); $this->twig = $this->createStub(Environment::class); diff --git a/tests/Block/AdminSearchBlockServiceTest.php b/tests/Block/AdminSearchBlockServiceTest.php index 697de36aa1..2206cab8f0 100644 --- a/tests/Block/AdminSearchBlockServiceTest.php +++ b/tests/Block/AdminSearchBlockServiceTest.php @@ -25,7 +25,7 @@ /** * @author Sullivan Senechal */ -class AdminSearchBlockServiceTest extends BlockServiceTestCase +final class AdminSearchBlockServiceTest extends BlockServiceTestCase { use ExpectDeprecationTrait; @@ -101,7 +101,7 @@ public function testGlobalSearchReturnsEmptyWhenFiltersAreDisabled(): void ->willReturn($adminCode); $blockService = new AdminSearchBlockService( - $this->createMock(Environment::class), + $this->createStub(Environment::class), $this->pool, $this->searchHandler, 'show'