SendMailAction example


            );
        }

        $transportDecorator = new MailerTransportDecorator(
            $this->createMock(TransportInterface::class),
            $this->getContainer()->get(MailAttachmentsBuilder::class),
            $this->getContainer()->get('shopware.filesystem.public'),
            $this->getContainer()->get('document.repository')
        );
        $mailService = new TestEmailService($this->getContainer()->get(MailFactory::class)$transportDecorator);
        $subscriber = new SendMailAction(
            $mailService,
            $this->getContainer()->get('mail_template.repository'),
            $this->getContainer()->get('logger'),
            $this->getContainer()->get('event_dispatcher'),
            $this->getContainer()->get('mail_template_type.repository'),
            $this->getContainer()->get(Translator::class),
            $this->getContainer()->get(Connection::class),
            $this->getContainer()->get(LanguageLocaleCodeProvider::class),
            true
        );

        
private SendMailAction $action;

    protected function setUp(): void
    {
        $this->mailTemplate = new MailTemplateEntity();
        $this->mailService = $this->createMock(AbstractMailService::class);
        $this->mailTemplateRepository = $this->createMock(EntityRepository::class);
        $this->languageLocaleProvider = $this->createMock(LanguageLocaleCodeProvider::class);
        $this->translator = $this->createMock(Translator::class);
        $this->entitySearchResult = $this->createMock(EntitySearchResult::class);

        $this->action = new SendMailAction(
            $this->mailService,
            $this->mailTemplateRepository,
            $this->createMock(LoggerInterface::class),
            $this->createMock(EventDispatcherInterface::class),
            $this->createMock(EntityRepository::class),
            $this->translator,
            $this->createMock(Connection::class),
            $this->languageLocaleProvider,
            true
        );
    }

    
Home | Imprint | This part of the site doesn't use cookies.