Changeset 361 in tests
- Timestamp:
- 06/02/2011 11:30:46 AM (13 years ago)
- Location:
- wp-testdata
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testdata/sample_blogs.php
r325 r361 84 84 } 85 85 86 // a faster way to get the Theme Test Data(test-data.2011-01-17.xml) dataset than using the importer 87 class _WPDataset2 extends _WPEmptyBlog { 88 function setUp() { 89 parent::setUp(); 90 $this->_nuke_main_tables(); 91 $this->_load_sql_dump(DIR_TESTDATA . '/export/test-data.2011-01-17.sql'); 92 } 93 94 function tearDown() { 95 $this->_nuke_main_tables(); 96 parent::tearDown(); 97 } 98 99 function _nuke_main_tables() { 100 global $wpdb; 101 // crude but effective: make sure there's no residual data in the main tables 102 foreach ( array('posts', 'postmeta', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta') as $table) 103 $wpdb->query("DELETE FROM {$wpdb->$table}"); 104 } 105 } 106 86 107 ?>
Note: See TracChangeset
for help on using the changeset viewer.