protected function setUp() { $this->entityManager = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock(); $this->twig = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Provider\\EmailRenderer')->disableOriginalConstructor()->getMock(); $this->mailer = $this->getMockBuilder('\\Swift_Mailer')->disableOriginalConstructor()->getMock(); $this->logger = $this->getMockBuilder('Monolog\\Logger')->disableOriginalConstructor()->getMock(); $this->processor = new EmailNotificationProcessor($this->twig, $this->mailer, $this->entityManager, '*****@*****.**', $this->logger); $this->processor->setEnv('prod'); $this->processor->setMessageLimit(10); }
protected function setUp() { $this->logger = $this->getMock('Psr\\Log\\LoggerInterface'); $this->entityManager = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock(); $this->entityPool = $this->getMockBuilder('Oro\\Bundle\\NotificationBundle\\Doctrine\\EntityPool')->disableOriginalConstructor()->getMock(); $this->emailRenderer = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Provider\\EmailRenderer')->disableOriginalConstructor()->getMock(); $this->mailer = $this->getMockBuilder('Swift_Mailer')->disableOriginalConstructor()->getMock(); $this->cm = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager')->disableOriginalConstructor()->getMock(); $this->cm->expects($this->any())->method('get')->will($this->returnValueMap([['oro_notification.email_notification_sender_email', false, false, self::TEST_SENDER_EMAIL], ['oro_notification.email_notification_sender_name', false, false, self::TEST_SENDER_NAME]])); $this->processor = new EmailNotificationProcessor($this->logger, $this->entityManager, $this->entityPool, $this->emailRenderer, $this->mailer, $this->cm); $this->processor->setEnv(self::TEST_ENV); $this->processor->setMessageLimit(self::TEST_MESSAGE_LIMIT); }