| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | $tests = array( |
|---|
| 7 | array( 'Old', $wpdb->get_tables('old'), $wpdb->old_tables ), # test old tables |
|---|
| 8 | array( 'All', $wpdb->get_tables('all'), $wpdb->tables), # test all tables |
|---|
| 9 | array( 'Current', $wpdb->get_tables('current'), array_diff($wpdb->tables, $wpdb->old_tables ) ), |
|---|
| 10 | # test current tables |
|---|
| 11 | array( 'Default', $wpdb->get_tables('current'), $wpdb->get_tables() ), # test default argument |
|---|
| 12 | ); |
|---|
| 13 | |
|---|
| 14 | foreach ($tests as $test) { |
|---|
| 15 | list($name, $one, $two) = $test; |
|---|
| 16 | $same = ( $one === $two ); |
|---|
| 17 | $result = $same ? 'OK' : 'FAILED'; |
|---|
| 18 | printf('<h2>%s-Test</h2>Result: %s<hr>', $name, $result); |
|---|
| 19 | } |
|---|
| 20 | |
|---|