public function testAddDelTask() { $COUNT = intval(file_get_contents('./data/count')); $COUNT++; addTask("polo", "marco", "2016-01-01", "wip", $COUNT); $WIP = json_decode(file_get_contents('./data/wip.json'), true); $this->assertEquals('marco', $WIP[$COUNT]['data']); delTask($COUNT, "wip"); $WIP = json_decode(file_get_contents('./data/wip.json'), true); $this->assertFalse(isset($WIP[$COUNT])); }
//Deletes tasks TODO... if (isset($_POST['deltodo'])) { foreach ($_POST['deltodo'] as $delete => $void) { delTask($delete, "todo"); } } //... WIP ... if (isset($_POST['delwip'])) { foreach ($_POST['delwip'] as $delete => $void) { delTask($delete, "wip"); } } //... and ENDED if (isset($_POST['delended'])) { foreach ($_POST['delended'] as $delete => $void) { delTask($delete, "done"); } } //Loads the desired language file $LOCALE = json_decode(file_get_contents('./data/' . $_SESSION['LANG'] . '.json'), true); //Task loader $TODO = json_decode(file_get_contents('./data/todo.json'), true); $WIP = json_decode(file_get_contents('./data/wip.json'), true); $ENDED = json_decode(file_get_contents('./data/done.json'), true); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">