/**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     // Mock a logger.
     $this->logger = $this->prophesize(LoggerInterface::class);
     // Mock the logger service, make it return our mocked logger, and register
     // it in the container.
     $this->loggerFactory = $this->prophesize(LoggerChannelFactoryInterface::class);
     $this->loggerFactory->get('rules')->willReturn($this->logger->reveal());
     $this->container->set('logger.factory', $this->loggerFactory->reveal());
     // Mock a parameter bag.
     $this->parameterBag = $this->prophesize(ParameterBag::class);
     // Mock a request, and set our mocked parameter bag as it attributes
     // property.
     $this->currentRequest = $this->prophesize(Request::class);
     $this->currentRequest->attributes = $this->parameterBag->reveal();
     // Mock the request stack, make it return our mocked request when the
     // current request is requested, and register it in the container.
     $this->requestStack = $this->prophesize(RequestStack::class);
     $this->requestStack->getCurrentRequest()->willReturn($this->currentRequest);
     $this->container->set('request_stack', $this->requestStack->reveal());
     // Mock the current path stack.
     $this->currentPathStack = $this->prophesize(CurrentPathStack::class);
     $this->container->set('path.current', $this->currentPathStack->reveal());
     // Instantiate the redirect action.
     $this->action = $this->actionManager->createInstance('rules_page_redirect');
 }
 protected function setUp()
 {
     parent::setUp();
     $this->logger = $this->prophesize(LoggerInterface::class);
     $this->messageSerializer = $this->prophesize(MessageSerializer::class);
     $this->SUT = new CommandAuditor($this->logger->reveal(), $this->messageSerializer->reveal());
 }
 protected function setUp()
 {
     $this->logger = $this->prophesize(LoggerInterface::class);
     $this->handler = new LogHandler($this->logger->reveal());
     $this->consumerContainer = $this->prophesize(ConsumerContainer::class);
     $this->consumerContainer->getMessageClass()->willReturn(self::MESSAGE_CLASS);
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->logger = $this->prophesize(LoggerInterface::class);
     $this->mailManager = $this->prophesize(MailManagerInterface::class);
     $this->container->set('logger.factory', $this->logger->reveal());
     $this->container->set('plugin.manager.mail', $this->mailManager->reveal());
     $this->action = $this->actionManager->createInstance('rules_send_email');
 }
Example #5
0
 public function setUp()
 {
     parent::setUp();
     $this->contentQueryExecutor = $this->prophesize('Sulu\\Component\\Content\\Query\\ContentQueryExecutorInterface');
     $this->contentQueryBuilder = $this->prophesize('Sulu\\Component\\Content\\Query\\ContentQueryBuilderInterface');
     $this->logger = $this->prophesize('Psr\\Log\\LoggerInterface');
     $this->property = $this->prophesize('Sulu\\Component\\Content\\Compat\\PropertyInterface');
     $this->type = new InternalLinks($this->contentQueryExecutor->reveal(), $this->contentQueryBuilder->reveal(), $this->logger->reveal(), 'some_template.html.twig');
 }
 public function setUp()
 {
     parent::setUp();
     $this->mockLogger = $this->prophesize(LoggerInterface::class);
     $this->mockManager = $this->prophesize(KeyPairManager::class);
     $this->mockStorage = $this->prophesize(KeyPairStorage::class);
     $this->mockStorage->getRootPath()->willReturn('~/.acme/certificates');
     $this->service = new KeyPairProvider($this->mockManager->reveal(), $this->mockStorage->reveal());
     $this->service->setLogger($this->mockLogger->reveal());
 }
 protected function setUp()
 {
     parent::setUp();
     $this->logger = $this->createLoggerMock();
     $this->encoderMock = $this->createEncoderMock();
     $this->decoderMock = $this->createDecoderMock();
     $this->encoderResolverMock = $this->createEncoderResolverMock();
     $this->decoderResolverMock = $this->createDecoderResolverMock();
     $this->transcoderFactory = new TranscoderFactory($this->decoderResolverMock->reveal(), $this->encoderResolverMock->reveal(), $this->logger->reveal());
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->logger = $this->prophesize(LoggerInterface::class);
     $logger_factory = $this->prophesize(LoggerChannelFactoryInterface::class);
     $logger_factory->get('rules')->willReturn($this->logger->reveal());
     $this->mailManager = $this->prophesize(MailManagerInterface::class);
     // @todo this is wrong, the logger is no factory.
     $this->container->set('logger.factory', $logger_factory->reveal());
     $this->container->set('plugin.manager.mail', $this->mailManager->reveal());
     $this->action = $this->actionManager->createInstance('rules_send_email');
 }
 public function setUp()
 {
     $this->apiKeyManager = $this->prophesize('AppBundle\\Security\\ApiKeyManager');
     $this->logger = $this->prophesize('Psr\\Log\\LoggerInterface');
     $this->apiKeyAuthenticator = new ApiKeyAuthenticator($this->apiKeyManager->reveal(), $this->logger->reveal());
 }
 /** {@inheritdoc} */
 protected function setUp()
 {
     $this->logger = $this->prophesize(LoggerInterface::class);
     $this->converter = $this->prophesize(ObjectToArrayConverterInterface::class);
     $this->logstash = new Logstash($this->logger->reveal(), $this->converter->reveal());
 }
 public function setUp()
 {
     parent::setUp();
     $this->mockLogger = $this->prophesize(LoggerInterface::class);
     $this->service = new LogCommandListener($this->mockLogger->reveal());
 }
 /** {@inheritdoc} */
 protected function setUp()
 {
     $this->logger = $this->prophesize(LoggerInterface::class);
     $this->logstash = $this->prophesize(Logstash::class);
     $this->middleware = new LogEventMiddleware($this->logstash->reveal(), $this->logger->reveal());
 }
 protected function setUp()
 {
     $this->logger = $this->prophesize(LoggerInterface::class);
     $this->subscriber = new LogSubscriber($this->logger->reveal());
 }