Changeset 33994 for branches/4.0/tests/phpunit/tests/db.php
- Timestamp:
- 09/10/2015 07:04:04 AM (11 years ago)
- File:
-
- 1 edited
-
branches/4.0/tests/phpunit/tests/db.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0/tests/phpunit/tests/db.php
r32413 r33994 492 492 function data_get_table_from_query() { 493 493 $table = 'a_test_table_name'; 494 $db_table = '`a_test_db`.`another_test_table`'; 494 $more_tables = array( 495 // table_name => expected_value 496 '`a_test_db`.`another_test_table`' => 'a_test_db.another_test_table', 497 'a-test-with-dashes' => 'a-test-with-dashes', 498 ); 495 499 496 500 $queries = array( … … 597 601 $querycount = count( $queries ); 598 602 for ( $ii = 0; $ii < $querycount; $ii++ ) { 599 $db_query = str_replace( $table, $db_table, $queries[ $ii ] ); 600 $expected_db_table = str_replace( '`', '', $db_table ); 603 foreach ( $more_tables as $name => $expected_name ) { 604 $new_query = str_replace( $table, $name, $queries[ $ii ] ); 605 $queries[] = array( $new_query, $expected_name ); 606 } 601 607 602 608 $queries[ $ii ] = array( $queries[ $ii ], $table ); 603 $queries[] = array( $db_query, $expected_db_table );604 609 } 605 610 return $queries;
Note: See TracChangeset
for help on using the changeset viewer.