public function testStop() { $this->notifier->expects($this->once())->method('notify')->with(NotifierInterface::MESSAGE_UPDATE); $task = $this->loadTask(); $task->setStatus(Task::STATUS_STARTED); self::$DI['app']['orm.em']->persist($task); self::$DI['app']['orm.em']->flush(); $this->sut->stop($task); $this->assertEquals(Task::STATUS_STOPPED, $task->getStatus()); }
public function testStop() { $notifier = $this->createNotifierMock(); $notifier->expects($this->once())->method('notify')->with(Notifier::MESSAGE_UPDATE); $manipulator = new TaskManipulator(self::$DI['app']['EM'], $notifier, self::$DI['app']['translator'], self::$DI['app']['repo.tasks']); $task = $this->loadTask(); $task->setStatus(Task::STATUS_STARTED); self::$DI['app']['EM']->persist($task); self::$DI['app']['EM']->flush(); $manipulator->stop($task); $this->assertEquals(Task::STATUS_STOPPED, $task->getStatus()); }