diff --git a/UPGRADE-3.x.md b/UPGRADE-3.x.md index 15b7e126..5b1ae344 100644 --- a/UPGRADE-3.x.md +++ b/UPGRADE-3.x.md @@ -4,6 +4,10 @@ UPGRADE 3.x UPGRADE FROM 3.x to 3.x ======================= +### Close API + +Most of the classes have been marked as `@final` and they will be final in `4.0`. + ### Upgrade to SonataDatagridBundle 3.0 There is a minimal BC Break on `MessageManager::getPager`. If you are extending this method you should add parameter and return type hints. diff --git a/src/Admin/MessageAdmin.php b/src/Admin/MessageAdmin.php index fc178d80..60eef0b0 100644 --- a/src/Admin/MessageAdmin.php +++ b/src/Admin/MessageAdmin.php @@ -22,6 +22,7 @@ /** * @phpstan-extends AbstractAdmin<\Sonata\NotificationBundle\Model\Message> + * @final since sonata-project/notification-bundle 3.x */ class MessageAdmin extends AbstractAdmin { diff --git a/src/Backend/AMQPBackend.php b/src/Backend/AMQPBackend.php index aaabcd4e..ee66f45f 100644 --- a/src/Backend/AMQPBackend.php +++ b/src/Backend/AMQPBackend.php @@ -31,6 +31,8 @@ /** * Consumer side of the rabbitMQ backend. + * + * @final since sonata-project/notification-bundle 3.x */ class AMQPBackend implements BackendInterface { diff --git a/src/Backend/AMQPBackendDispatcher.php b/src/Backend/AMQPBackendDispatcher.php index 9f19eb3c..d4d7ba35 100644 --- a/src/Backend/AMQPBackendDispatcher.php +++ b/src/Backend/AMQPBackendDispatcher.php @@ -28,6 +28,8 @@ /** * Producer side of the rabbitmq backend. + * + * @final since sonata-project/notification-bundle 3.x */ class AMQPBackendDispatcher extends QueueBackendDispatcher { diff --git a/src/Backend/BackendHealthCheck.php b/src/Backend/BackendHealthCheck.php index 1e8f52e7..59b80f95 100644 --- a/src/Backend/BackendHealthCheck.php +++ b/src/Backend/BackendHealthCheck.php @@ -15,6 +15,9 @@ use Laminas\Diagnostics\Check\AbstractCheck; +/** + * @final since sonata-project/notification-bundle 3.x + */ class BackendHealthCheck extends AbstractCheck { /** diff --git a/src/Backend/MessageManagerBackend.php b/src/Backend/MessageManagerBackend.php index cbf54b04..76f641f4 100644 --- a/src/Backend/MessageManagerBackend.php +++ b/src/Backend/MessageManagerBackend.php @@ -23,6 +23,9 @@ use Sonata\NotificationBundle\Model\MessageManagerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class MessageManagerBackend implements BackendInterface { /** diff --git a/src/Backend/MessageManagerBackendDispatcher.php b/src/Backend/MessageManagerBackendDispatcher.php index 89aa52cf..ddb06259 100644 --- a/src/Backend/MessageManagerBackendDispatcher.php +++ b/src/Backend/MessageManagerBackendDispatcher.php @@ -20,6 +20,8 @@ /** * Producer side of the doctrine backend. + * + * @final since sonata-project/notification-bundle 3.x */ class MessageManagerBackendDispatcher extends QueueBackendDispatcher { diff --git a/src/Backend/PostponeRuntimeBackend.php b/src/Backend/PostponeRuntimeBackend.php index 8aa2133e..aa164552 100644 --- a/src/Backend/PostponeRuntimeBackend.php +++ b/src/Backend/PostponeRuntimeBackend.php @@ -26,6 +26,8 @@ * @see https://gist.github.com/3852361 * * @author Toni Uebernickel + * + * @final since sonata-project/notification-bundle 3.x */ class PostponeRuntimeBackend extends RuntimeBackend { diff --git a/src/Command/CleanupCommand.php b/src/Command/CleanupCommand.php index 0e46615e..ac39ed97 100644 --- a/src/Command/CleanupCommand.php +++ b/src/Command/CleanupCommand.php @@ -19,6 +19,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class CleanupCommand extends ContainerAwareCommand { public function configure() diff --git a/src/Command/ConsumerHandlerCommand.php b/src/Command/ConsumerHandlerCommand.php index 878abcc9..7d436dd5 100644 --- a/src/Command/ConsumerHandlerCommand.php +++ b/src/Command/ConsumerHandlerCommand.php @@ -25,6 +25,9 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class ConsumerHandlerCommand extends ContainerAwareCommand { public function configure() diff --git a/src/Command/CreateAndPublishCommand.php b/src/Command/CreateAndPublishCommand.php index 80e7fc99..feb49c4b 100644 --- a/src/Command/CreateAndPublishCommand.php +++ b/src/Command/CreateAndPublishCommand.php @@ -18,6 +18,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class CreateAndPublishCommand extends ContainerAwareCommand { public function configure() diff --git a/src/Command/ListHandlerCommand.php b/src/Command/ListHandlerCommand.php index 62890c0d..e21e1dbc 100644 --- a/src/Command/ListHandlerCommand.php +++ b/src/Command/ListHandlerCommand.php @@ -17,6 +17,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class ListHandlerCommand extends ContainerAwareCommand { public function configure() diff --git a/src/Command/ListQueuesCommand.php b/src/Command/ListQueuesCommand.php index dcfaee80..ecd98514 100644 --- a/src/Command/ListQueuesCommand.php +++ b/src/Command/ListQueuesCommand.php @@ -18,6 +18,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class ListQueuesCommand extends ContainerAwareCommand { public function configure() diff --git a/src/Command/RestartCommand.php b/src/Command/RestartCommand.php index a91c194f..ce2c7d1d 100644 --- a/src/Command/RestartCommand.php +++ b/src/Command/RestartCommand.php @@ -24,6 +24,9 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class RestartCommand extends ContainerAwareCommand { public function configure() diff --git a/src/Consumer/ConsumerEvent.php b/src/Consumer/ConsumerEvent.php index 3894691c..5431a0a0 100644 --- a/src/Consumer/ConsumerEvent.php +++ b/src/Consumer/ConsumerEvent.php @@ -16,6 +16,9 @@ use Sonata\NotificationBundle\Model\MessageInterface; use Symfony\Contracts\EventDispatcher\Event; +/** + * @final since sonata-project/notification-bundle 3.x + */ class ConsumerEvent extends Event implements ConsumerEventInterface { /** diff --git a/src/Consumer/ConsumerReturnInfo.php b/src/Consumer/ConsumerReturnInfo.php index 7ea4bd6b..66cc9a1f 100644 --- a/src/Consumer/ConsumerReturnInfo.php +++ b/src/Consumer/ConsumerReturnInfo.php @@ -17,6 +17,8 @@ * Return informations for comsumers. * * @author Kevin Nedelec + * + * @final since sonata-project/notification-bundle 3.x */ class ConsumerReturnInfo { diff --git a/src/Consumer/LoggerConsumer.php b/src/Consumer/LoggerConsumer.php index b1bc8b3d..b9c7c578 100644 --- a/src/Consumer/LoggerConsumer.php +++ b/src/Consumer/LoggerConsumer.php @@ -16,6 +16,9 @@ use Psr\Log\LoggerInterface; use Sonata\NotificationBundle\Exception\InvalidParameterException; +/** + * @final since sonata-project/notification-bundle 3.x + */ class LoggerConsumer implements ConsumerInterface { /** diff --git a/src/Consumer/Metadata.php b/src/Consumer/Metadata.php index eacec72c..73eb2b9c 100644 --- a/src/Consumer/Metadata.php +++ b/src/Consumer/Metadata.php @@ -13,6 +13,9 @@ namespace Sonata\NotificationBundle\Consumer; +/** + * @final since sonata-project/notification-bundle 3.x + */ class Metadata { /** diff --git a/src/Consumer/SwiftMailerConsumer.php b/src/Consumer/SwiftMailerConsumer.php index 4875b64e..d0dd64c5 100644 --- a/src/Consumer/SwiftMailerConsumer.php +++ b/src/Consumer/SwiftMailerConsumer.php @@ -15,6 +15,9 @@ use Sonata\NotificationBundle\Model\MessageInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class SwiftMailerConsumer implements ConsumerInterface { /** diff --git a/src/Controller/Api/MessageController.php b/src/Controller/Api/MessageController.php index ec0a4fdf..f3a61121 100644 --- a/src/Controller/Api/MessageController.php +++ b/src/Controller/Api/MessageController.php @@ -27,6 +27,8 @@ /** * @author Hugo Briand + * + * @final since sonata-project/notification-bundle 3.x */ class MessageController { diff --git a/src/Controller/MessageAdminController.php b/src/Controller/MessageAdminController.php index e294cbe7..9aaddc96 100644 --- a/src/Controller/MessageAdminController.php +++ b/src/Controller/MessageAdminController.php @@ -20,6 +20,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Security\Core\Exception\AccessDeniedException; +/** + * @final since sonata-project/notification-bundle 3.x + */ class MessageAdminController extends CRUDController { /** diff --git a/src/DependencyInjection/Compiler/NotificationCompilerPass.php b/src/DependencyInjection/Compiler/NotificationCompilerPass.php index f6bbc25e..68c90cbb 100644 --- a/src/DependencyInjection/Compiler/NotificationCompilerPass.php +++ b/src/DependencyInjection/Compiler/NotificationCompilerPass.php @@ -21,6 +21,11 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Reference; +/** + * @final since sonata-project/notification-bundle 3.x + * + * @internal since sonata-project/notification-bundle 4.0 + */ class NotificationCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index ebd1ef1b..ef712878 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -19,6 +19,9 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() diff --git a/src/DependencyInjection/SonataNotificationExtension.php b/src/DependencyInjection/SonataNotificationExtension.php index 2c4c9acf..9cb1166c 100644 --- a/src/DependencyInjection/SonataNotificationExtension.php +++ b/src/DependencyInjection/SonataNotificationExtension.php @@ -26,6 +26,9 @@ use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\DependencyInjection\Extension; +/** + * @final since sonata-project/notification-bundle 3.x + */ class SonataNotificationExtension extends Extension { /** diff --git a/src/Entity/MessageManager.php b/src/Entity/MessageManager.php index c371ae63..64e74ffd 100644 --- a/src/Entity/MessageManager.php +++ b/src/Entity/MessageManager.php @@ -20,6 +20,9 @@ use Sonata\NotificationBundle\Model\MessageInterface; use Sonata\NotificationBundle\Model\MessageManagerInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class MessageManager extends BaseEntityManager implements MessageManagerInterface { public function save($entity, $andFlush = true) diff --git a/src/Event/DoctrineBackendOptimizeListener.php b/src/Event/DoctrineBackendOptimizeListener.php index fa643abb..bcf13de2 100644 --- a/src/Event/DoctrineBackendOptimizeListener.php +++ b/src/Event/DoctrineBackendOptimizeListener.php @@ -21,6 +21,8 @@ * Used with doctrine backend to clear context taking care of the batch iterations. * * @author Kevin Nedelec + * + * @final since sonata-project/notification-bundle 3.x */ class DoctrineBackendOptimizeListener implements IterationListener { diff --git a/src/Event/DoctrineOptimizeListener.php b/src/Event/DoctrineOptimizeListener.php index c8348a2f..e169cedb 100644 --- a/src/Event/DoctrineOptimizeListener.php +++ b/src/Event/DoctrineOptimizeListener.php @@ -21,6 +21,8 @@ * Do not use with doctrine backend, use DoctrineBackendOptimizeListener instead. * * @author Kevin Nedelec + * + * @final since sonata-project/notification-bundle 3.x */ class DoctrineOptimizeListener implements IterationListener { diff --git a/src/Event/IterateEvent.php b/src/Event/IterateEvent.php index 4d10a547..c4db2b11 100644 --- a/src/Event/IterateEvent.php +++ b/src/Event/IterateEvent.php @@ -22,6 +22,8 @@ * Event for ConsumerHandlerCommand iterations event. * * @author Kevin Nedelec + * + * @final since sonata-project/notification-bundle 3.x */ class IterateEvent extends Event { diff --git a/src/Exception/BackendNotFoundException.php b/src/Exception/BackendNotFoundException.php index 00d3221f..e540debd 100644 --- a/src/Exception/BackendNotFoundException.php +++ b/src/Exception/BackendNotFoundException.php @@ -13,6 +13,9 @@ namespace Sonata\NotificationBundle\Exception; +/** + * @final since sonata-project/notification-bundle 3.x + */ class BackendNotFoundException extends \RuntimeException { } diff --git a/src/Exception/HandlingException.php b/src/Exception/HandlingException.php index 7ffac2d2..950c3095 100644 --- a/src/Exception/HandlingException.php +++ b/src/Exception/HandlingException.php @@ -13,6 +13,9 @@ namespace Sonata\NotificationBundle\Exception; +/** + * @final since sonata-project/notification-bundle 3.x + */ class HandlingException extends \RuntimeException { } diff --git a/src/Exception/InvalidParameterException.php b/src/Exception/InvalidParameterException.php index 6b4bf1a0..735e544c 100644 --- a/src/Exception/InvalidParameterException.php +++ b/src/Exception/InvalidParameterException.php @@ -20,6 +20,9 @@ class InvalidParameterException extends CoreBundleException { } } else { + /** + * @final since sonata-project/notification-bundle 3.x + */ class InvalidParameterException extends \RuntimeException { } diff --git a/src/Form/Type/MessageSerializationType.php b/src/Form/Type/MessageSerializationType.php index 55ece1b5..93887e39 100644 --- a/src/Form/Type/MessageSerializationType.php +++ b/src/Form/Type/MessageSerializationType.php @@ -15,6 +15,9 @@ use Sonata\Form\Type\BaseDoctrineORMSerializationType; +/** + * @final since sonata-project/notification-bundle 3.x + */ class MessageSerializationType extends BaseDoctrineORMSerializationType { } diff --git a/src/Iterator/AMQPMessageIterator.php b/src/Iterator/AMQPMessageIterator.php index d2219178..ea70ba36 100644 --- a/src/Iterator/AMQPMessageIterator.php +++ b/src/Iterator/AMQPMessageIterator.php @@ -18,6 +18,9 @@ use PhpAmqpLib\Message\AMQPMessage; use Sonata\NotificationBundle\Model\Message; +/** + * @final since sonata-project/notification-bundle 3.x + */ class AMQPMessageIterator implements MessageIteratorInterface { /** diff --git a/src/Iterator/ErroneousMessageIterator.php b/src/Iterator/ErroneousMessageIterator.php index 582b6fc4..eb941fdf 100644 --- a/src/Iterator/ErroneousMessageIterator.php +++ b/src/Iterator/ErroneousMessageIterator.php @@ -16,6 +16,9 @@ use Sonata\NotificationBundle\Model\MessageInterface; use Sonata\NotificationBundle\Model\MessageManagerInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class ErroneousMessageIterator extends MessageManagerMessageIterator { /** diff --git a/src/Iterator/IteratorProxyMessageIterator.php b/src/Iterator/IteratorProxyMessageIterator.php index dc394519..e4a5fd22 100644 --- a/src/Iterator/IteratorProxyMessageIterator.php +++ b/src/Iterator/IteratorProxyMessageIterator.php @@ -15,6 +15,8 @@ /** * @author Toni Uebernickel + * + * @final since sonata-project/notification-bundle 3.x */ class IteratorProxyMessageIterator implements MessageIteratorInterface { diff --git a/src/Selector/ErroneousMessagesSelector.php b/src/Selector/ErroneousMessagesSelector.php index 5ed057a0..db7a2569 100644 --- a/src/Selector/ErroneousMessagesSelector.php +++ b/src/Selector/ErroneousMessagesSelector.php @@ -16,6 +16,9 @@ use Doctrine\Persistence\ManagerRegistry; use Sonata\NotificationBundle\Model\MessageInterface; +/** + * @final since sonata-project/notification-bundle 3.x + */ class ErroneousMessagesSelector { /** diff --git a/src/SonataNotificationBundle.php b/src/SonataNotificationBundle.php index 35b451ef..7aefcef8 100644 --- a/src/SonataNotificationBundle.php +++ b/src/SonataNotificationBundle.php @@ -19,6 +19,9 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; +/** + * @final since sonata-project/notification-bundle 3.x + */ class SonataNotificationBundle extends Bundle { public function build(ContainerBuilder $container) diff --git a/tests/Entity/DummyMessageManager.php b/tests/Entity/DummyMessageManager.php new file mode 100644 index 00000000..9efe2049 --- /dev/null +++ b/tests/Entity/DummyMessageManager.php @@ -0,0 +1,136 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\NotificationBundle\Tests\Entity; + +use Doctrine\ORM\QueryBuilder; +use Doctrine\Persistence\ManagerRegistry; +use Sonata\DatagridBundle\Pager\Doctrine\Pager; +use Sonata\DatagridBundle\Pager\PagerInterface; +use Sonata\NotificationBundle\Model\MessageInterface; +use Sonata\NotificationBundle\Model\MessageManagerInterface; + +final class DummyMessageManager implements MessageManagerInterface +{ + /** + * @var ManagerRegistry + */ + private $registry; + + /** + * @phpstan-var class-string + */ + private $class; + + /** + * @phpstan-param class-string $class + */ + public function __construct(string $class, ManagerRegistry $registry) + { + $this->registry = $registry; + $this->class = $class; + } + + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array + { + $result = []; + while (null !== $limit && $limit > 0) { + $result[$limit] = new Message(); + --$limit; + } + + return $result; + } + + public function findByTypes(array $types, $state, $batchSize): array + { + $result = []; + while (null !== $batchSize && $batchSize > 0) { + $result[$batchSize] = new Message(); + --$batchSize; + } + + return $result; + } + + public function save($entity, $andFlush = true): void + { + } + + public function getClass(): string + { + return $this->class; + } + + public function findAll(): array + { + return []; + } + + public function findOneBy(array $criteria, ?array $orderBy = null): ?object + { + return null; + } + + public function find($id): ?object + { + return null; + } + + public function create(): object + { + return new $this->class(); + } + + public function delete($entity, $andFlush = true): void + { + } + + public function getTableName(): string + { + throw new \LogicException('Not implemented.'); + } + + public function getConnection() + { + return $this->registry->getConnection(); + } + + public function countStates(): int + { + return 0; + } + + public function cleanup($maxAge): void + { + } + + public function cancel(MessageInterface $message): void + { + } + + public function restart(MessageInterface $message): object + { + return $message; + } + + public function findByAttempts(array $types, $state, $batchSize, $maxAttempts = null, $attemptDelay = 10): array + { + return []; + } + + public function getPager(array $criteria, int $page, int $limit = 10, array $sort = []): PagerInterface + { + return Pager::create($this->createStub(QueryBuilder::class), $limit, $page); + } +} diff --git a/tests/Entity/MessageManagerMock.php b/tests/Entity/MessageManagerMock.php deleted file mode 100644 index 0a59701c..00000000 --- a/tests/Entity/MessageManagerMock.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sonata\NotificationBundle\Tests\Entity; - -use Sonata\NotificationBundle\Entity\MessageManager; - -/** - * @author Kevin Nedelec - */ -class MessageManagerMock extends MessageManager -{ - public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array - { - $result = []; - while (null !== $limit && $limit > 0) { - $result[$limit] = new Message(); - --$limit; - } - - return $result; - } - - public function findByTypes(array $types, $state, $batchSize): array - { - $result = []; - while (null !== $batchSize && $batchSize > 0) { - $result[$batchSize] = new Message(); - --$batchSize; - } - - return $result; - } - - public function save($entity, $andFlush = true): void - { - } -} diff --git a/tests/Entity/MessageManagerTest.php b/tests/Entity/MessageManagerTest.php index a865ee89..8421f0ea 100644 --- a/tests/Entity/MessageManagerTest.php +++ b/tests/Entity/MessageManagerTest.php @@ -28,7 +28,7 @@ class MessageManagerTest extends TestCase { public function testCancel(): void { - $manager = $this->getMessageManagerMock(); + $manager = $this->createMessageManager(); $message = $this->getMessage(); @@ -39,7 +39,7 @@ public function testCancel(): void public function testRestart(): void { - $manager = $this->getMessageManagerMock(); + $manager = $this->createMessageManager(); // test un-restartable status $this->assertNull($manager->restart($this->getMessage(MessageInterface::STATE_OPEN))); @@ -150,13 +150,6 @@ public function testGetPagerWithInProgressMessages(): void ->getPager(['state' => MessageInterface::STATE_IN_PROGRESS], 1); } - protected function getMessageManagerMock(): MessageManagerMock - { - $registry = $this->createMock(ManagerRegistry::class); - - return new MessageManagerMock(Message::class, $registry); - } - protected function getMessageManager($qbCallback): MessageManager { $query = $this->getMockForAbstractClass( @@ -210,4 +203,24 @@ protected function getMessage($state = MessageInterface::STATE_OPEN): Message return $message; } + + private function createMessageManager(): MessageManager + { + $repository = $this->createMock(EntityRepository::class); + + $metadata = $this->createMock(ClassMetadata::class); + $metadata->method('getFieldNames')->willReturn([ + 'state', + 'type', + ]); + + $em = $this->createMock(EntityManager::class); + $em->method('getRepository')->willReturn($repository); + $em->method('getClassMetadata')->willReturn($metadata); + + $registry = $this->createMock(ManagerRegistry::class); + $registry->method('getManagerForClass')->willReturn($em); + + return new MessageManager(BaseMessage::class, $registry); + } } diff --git a/tests/Iterator/MessageManagerMessageIterator.php b/tests/Iterator/MessageManagerMessageIterator.php index 4a8fe4a0..1e01ebbe 100644 --- a/tests/Iterator/MessageManagerMessageIterator.php +++ b/tests/Iterator/MessageManagerMessageIterator.php @@ -16,7 +16,7 @@ use Doctrine\Persistence\ManagerRegistry; use Sonata\NotificationBundle\Iterator\MessageManagerMessageIterator as Iterator; use Sonata\NotificationBundle\Model\Message; -use Sonata\NotificationBundle\Tests\Entity\MessageManagerMock; +use Sonata\NotificationBundle\Tests\Entity\DummyMessageManager; /** * @author Kevin Nedelec @@ -26,7 +26,7 @@ class MessageManagerMessageIterator extends Iterator public function __construct(ManagerRegistry $registry, $pause = 0, $batchSize = 10) { parent::__construct( - new MessageManagerMock(Message::class, $registry), + new DummyMessageManager(Message::class, $registry), [], $pause, $batchSize