public function testUpdate()
 {
     $this->notifier->expects($this->once())->method('notify')->with(NotifierInterface::MESSAGE_UPDATE);
     $task = $this->loadTask();
     $task->setName('new name');
     $this->assertSame($task, $this->sut->update($task));
     self::$DI['app']['orm.em']->clear();
     $updated = self::$DI['app']['orm.em']->find('Phraseanet:Task', 1);
     $this->assertEquals($task, $updated);
 }
 public function testUpdate()
 {
     $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->setName('new name');
     $this->assertSame($task, $manipulator->update($task));
     self::$DI['app']['EM']->clear();
     $updated = self::$DI['app']['EM']->find('Phraseanet:Task', 1);
     $this->assertEquals($task, $updated);
 }