示例#1
0
 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);
 }
示例#2
0
 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);
 }