Fix StoredObjectApiControllerTest.php to match new dependency injection

This commit is contained in:
Julie Lenaerts 2025-02-26 11:11:57 +01:00
parent 3c801a6d0e
commit b597ff89e0

View File

@ -14,6 +14,7 @@ namespace Chill\DocStoreBundle\Tests\Controller;
use Chill\DocStoreBundle\Controller\StoredObjectApiController;
use Chill\DocStoreBundle\Entity\StoredObject;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ManagerRegistry;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\Security;
@ -45,7 +46,9 @@ class StoredObjectApiControllerTest extends TestCase
{"type": "stored-object", "id": 1}
JSON);
$controller = new StoredObjectApiController($security, $serializer, $entityManager);
$managerRegistry = $this->createMock(ManagerRegistry::class);
$controller = new StoredObjectApiController($security, $serializer, $entityManager, $managerRegistry);
$actual = $controller->createStoredObject();