public function testOnModeOff() { $this->topicPublisher->expects($this->once())->method('send')->with('oro/maintenance', array('isOn' => false, 'msg' => 'Maintenance mode is OFF')); /** @var MaintenanceListener $publisher */ $publisher = new MaintenanceListener($this->topicPublisher); $publisher->onModeOff(); }
public function testOnModeOff() { $expectedUserId = 42; $this->topicPublisher->expects($this->once())->method('send')->with('oro/maintenance', array('isOn' => false, 'userId' => $expectedUserId)); $this->securityFacade->expects($this->once())->method('getLoggedUserId')->will($this->returnValue($expectedUserId)); /** @var MaintenanceListener $publisher */ $publisher = new MaintenanceListener($this->topicPublisher, $this->securityFacade, $this->logger); $publisher->onModeOff(); }