mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
Fix tests
This commit is contained in:
@@ -14,9 +14,11 @@ namespace Chill\MainBundle\Tests\Controller;
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\MainBundle\Controller\ExportGenerationController;
|
||||
use Chill\MainBundle\Entity\ExportGeneration;
|
||||
use Chill\MainBundle\Export\ExportManager;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
use Psr\Log\NullLogger;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use Twig\Environment;
|
||||
@@ -38,13 +40,14 @@ class ExportGenerationControllerTest extends TestCase
|
||||
$environment = $this->prophesize(Environment::class);
|
||||
$serializer = $this->prophesize(SerializerInterface::class);
|
||||
$serializer->serialize(Argument::any(), 'json', ['groups' => ['read']])->willReturn('{}');
|
||||
$exportManager = $this->prophesize(ExportManager::class);
|
||||
|
||||
$pending = new ExportGeneration('dummy', []);
|
||||
|
||||
$controller = new ExportGenerationController($security->reveal(), $environment->reveal(), $serializer->reveal());
|
||||
$controller = new ExportGenerationController($security->reveal(), $environment->reveal(), $serializer->reveal(), $exportManager->reveal());
|
||||
|
||||
$actual = $controller->objectStatus($pending);
|
||||
self::assertEquals(json_encode(['status' => 'pending'], JSON_THROW_ON_ERROR), $actual->getContent());
|
||||
self::assertEquals('{}', $actual->getContent());
|
||||
|
||||
$generated = new ExportGeneration('dummy', []);
|
||||
$generated->getStoredObject()->setStatus(StoredObject::STATUS_READY);
|
||||
|
Reference in New Issue
Block a user