/** * @throws \Synapse\File\FileException * @expectedException \Synapse\File\FileException */ public function testDeleteWithS3ThrowingExceptionThrowsFileException() { $this->setupFileService(); $this->withDeleteObjectThrowingException(); $path = 'test'; $this->fs->delete($path); }
public function testCanDeleteFile() { $this->setupFileService($this->cfg); $data = self::TEST_BASE_PATH; $path = 'test'; $fileName = 'test.txt'; $this->fs->save($path, $fileName, $data); $success = $this->fs->delete($path . DIRECTORY_SEPARATOR . $fileName); $this->assertTrue($success, 'Unable to delete file'); $this->assertFileNotExists(self::TEST_BASE_PATH . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $fileName, 'Actual file was not removed.'); }