fileSystemHelper = new FileSystemHelper($baseFolder); } /** * @expectedException \Box\Spout\Common\Exception\IOException * @return void */ public function testCreateFolderShouldThrowExceptionIfOutsideOfBaseFolder() { $this->fileSystemHelper->createFolder('/tmp/folder_outside_base_folder', 'folder_name'); } /** * @expectedException \Box\Spout\Common\Exception\IOException * @return void */ public function testCreateFileWithContentsShouldThrowExceptionIfOutsideOfBaseFolder() { $this->fileSystemHelper->createFileWithContents('/tmp/folder_outside_base_folder', 'file_name', 'contents'); } /** * @expectedException \Box\Spout\Common\Exception\IOException * @return void */ public function testDeleteFileShouldThrowExceptionIfOutsideOfBaseFolder() { $this->fileSystemHelper->deleteFile('/tmp/folder_outside_base_folder/file_name'); } /** * @expectedException \Box\Spout\Common\Exception\IOException * @return void */ public function testDeleteFolderRecursivelyShouldThrowExceptionIfOutsideOfBaseFolder() { $this->fileSystemHelper->deleteFolderRecursively('/tmp/folder_outside_base_folder'); } }