Пример #1
0
 public function testExportToFile()
 {
     $posts_table_file = FileDataManager::getBackupPath('posts.tmp');
     $links_table_file = FileDataManager::getBackupPath('links.tmp');
     $users_table_file = FileDataManager::getBackupPath('users.tmp');
     if (file_exists($posts_table_file)) {
         unlink($posts_table_file);
     }
     if (file_exists($links_table_file)) {
         unlink($links_table_file);
     }
     if (file_exists($users_table_file)) {
         unlink($users_table_file);
     }
     $this->assertFalse(file_exists($posts_table_file));
     $this->assertFalse(file_exists($users_table_file));
     $this->assertFalse(file_exists($links_table_file));
     $this->dao->exportPostsLinksUsersToFile($posts_table_file, $links_table_file, $users_table_file);
     $this->assertTrue(file_exists($posts_table_file));
     $this->assertTrue(file_exists($users_table_file));
     $this->assertTrue(file_exists($links_table_file));
 }
Пример #2
0
 public function testExportToFile()
 {
     $posts_table_file = THINKUP_WEBAPP_PATH . BackupDAO::CACHE_DIR . '/posts.tmp';
     $links_table_file = THINKUP_WEBAPP_PATH . BackupDAO::CACHE_DIR . '/links.tmp';
     $users_table_file = THINKUP_WEBAPP_PATH . BackupDAO::CACHE_DIR . '/users.tmp';
     if (file_exists($posts_table_file)) {
         unlink($posts_table_file);
     }
     if (file_exists($links_table_file)) {
         unlink($links_table_file);
     }
     if (file_exists($users_table_file)) {
         unlink($users_table_file);
     }
     $this->assertFalse(file_exists($posts_table_file));
     $this->assertFalse(file_exists($users_table_file));
     $this->assertFalse(file_exists($links_table_file));
     $this->dao->exportPostsLinksUsersToFile($posts_table_file, $links_table_file, $users_table_file);
     $this->assertTrue(file_exists($posts_table_file));
     $this->assertTrue(file_exists($users_table_file));
     $this->assertTrue(file_exists($links_table_file));
 }