Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/db.php

    r33991 r33259  
    527527    function data_get_table_from_query() {
    528528        $table = 'a_test_table_name';
    529         $more_tables = array(
    530             // table_name => expected_value
    531             '`a_test_db`.`another_test_table`' => 'a_test_db.another_test_table',
    532             'a-test-with-dashes'               => 'a-test-with-dashes',
    533         );
     529        $db_table = '`a_test_db`.`another_test_table`';
    534530
    535531        $queries = array(
     
    641637        $querycount = count( $queries );
    642638        for ( $ii = 0; $ii < $querycount; $ii++ ) {
    643             foreach ( $more_tables as $name => $expected_name ) {
    644                 $new_query = str_replace( $table, $name, $queries[ $ii ] );
    645                 $queries[] = array( $new_query, $expected_name );
    646             }
     639            $db_query = str_replace( $table, $db_table, $queries[ $ii ] );
     640            $expected_db_table = str_replace( '`', '', $db_table );
    647641
    648642            $queries[ $ii ] = array( $queries[ $ii ], $table );
     643            $queries[] = array( $db_query, $expected_db_table );
    649644        }
    650645        return $queries;
Note: See TracChangeset for help on using the changeset viewer.