public function testInOut() { $ts = new Todos(); $ts->loadFromFile('todo.txt'); $file = tempnam(sys_get_temp_dir(), 'otodo'); $ts->saveToFile($file); $this->assertEquals(sha1_file('todo.txt'), sha1_file($file)); unlink($file); }
public function testASortPersistent() { $ts = new Todos(); $ts->loadFromFile('todo.txt'); $file = tempnam(sys_get_temp_dir(), 'otodo'); $ts->asort(array('done' => true, 'priority' => false, 'text' => false)); $ts->saveToFile($file); $this->assertEquals(sha1_file('todo.txt'), sha1_file($file)); unlink($file); }