/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->condition = $this->conditionManager->createInstance('rules_path_has_alias'); $this->englishLanguage = $this->prophesize(LanguageInterface::class); $this->englishLanguage->getId()->willReturn('en'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->aliasStorage = $this->prophesize(AliasStorageInterface::class); $this->container->set('path.alias_storage', $this->aliasStorage->reveal()); $this->action = $this->actionManager->createInstance('rules_path_alias_delete_by_alias'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->action = $this->actionManager->createInstance('rules_system_message'); // Clear the statically stored messages before every test run. $this->clearMessages(); }
/** * {@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'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->enableModule('user'); // Some of our plugins assume sessions exist: $session_manager = $this->prophesize(SessionManagerInterface::class); $this->container->set('session_manager', $session_manager->reveal()); }
/** * {@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'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); // We need the ban module. $this->enableModule('ban'); $this->banManager = $this->prophesize(BanIpManagerInterface::class); $this->container->set('ban.ip_manager', $this->banManager->reveal()); $this->request = $this->prophesize(Request::class); $this->container->set('request', $this->request->reveal()); $this->action = $this->actionManager->createInstance('rules_ban_ip'); }
/** * {@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'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->condition = $this->conditionManager->createInstance('rules_list_contains'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->action = $this->actionManager->createInstance('rules_list_item_remove'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->action = $this->actionManager->createInstance('rules_data_calculate_value'); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->condition = $this->conditionManager->createInstance('rules_data_is_empty'); }