public function testDelete() { $id = 5; $user = '******'; $folder = new Folder(); $folder->setId($id); $this->mapper->expects($this->once())->method('delete')->with($this->equalTo($folder)); $this->mapper->expects($this->once())->method('find')->with($this->equalTo($id), $this->equalTo($user))->will($this->returnValue($folder)); $this->newsService->delete($id, $user); }
public function testPurgeDeletedNoInterval() { $folder1 = new Folder(); $folder1->setId(3); $folder2 = new Folder(); $folder2->setId(5); $feeds = [$folder1, $folder2]; $this->folderMapper->expects($this->once())->method('getToDelete')->with($this->equalTo(null), $this->equalTo($this->user))->will($this->returnValue($feeds)); $this->folderMapper->expects($this->at(1))->method('delete')->with($this->equalTo($folder1)); $this->folderMapper->expects($this->at(2))->method('delete')->with($this->equalTo($folder2)); $this->folderService->purgeDeleted($this->user, false); }