public function deleteWithUrlExpectTrue() { $file = new parseFile('text/plain', 'Working at Parse is great!'); $save = $file->save('hello.txt'); //SET BOTH ARGUMENTS BELOW TO FALSE, SINCE WE ARE DELETING A FILE, NOT SAVING ONE $todelete = new parseFile(); $return = $todelete->delete($save->name); \Enhance\Assert::isTrue($return); }
/** * Load given file into object and return him. * * @param Integer $id Id of file to load * * @return IActive */ public function loadFile($id) { $name = $_SESSION["names"][$id]; try { if (file_exists(DIR_UPLOAD . $name)) { $parse = new \parseFile(); $this->activity = $parse->parse($name); return $this->activity; } else { throw new \Exception("There is no files with that name"); } } catch (\Exception $e) { $catcher = new \catcher($e); $catcher->show(); } }
foreach ($er as $error) { echo $error . '<br>'; } ?> </p> <?php } ?> <p><input type="file" name="uploadFile" value=""></p> <p class="submit"><input type="submit" name="getData" value="Получить данные"></p> </form> <?php if (isset($_POST) && array_key_exists('getData', $_POST)) { require_once '/modules/parseFile.php'; $file = new parseFile(); $xmlObj = $file->getXMLObj('uploadFile'); $arrData = $file->getDataArray(); $arrTitle = $file->getTitleArray(); $er = $file->error; } ?> <?php if ($arrTitle && is_array($arrTitle) && count($arrTitle) > 0) { foreach ($arrTitle as $listNum => $titles) { echo '<table>'; echo "<tr>"; foreach ($titles as $columnNum => $title) { echo "<td>{$title}</td>"; } echo "</tr>";