5 use \Drush\Sql\SqlTableSelectionTrait;
8 * Unit tests for expandWildcardTables() and filterTables().
13 class WildcardUnitCase extends \PHPUnit_Framework_TestCase
16 use SqlTableSelectionTrait;
19 * Tests drush_sql_expand_wildcard_tables().
21 * @see drush_sql_expand_wildcard_tables().
23 public function testExpandWildcardTables()
25 // Array of tables to search for.
29 // Mock array of tables to test with. This is
30 // also the expected result.
44 $expanded_db_tables = $this->expandWildcardTables($wildcard_input, $db_tables);
45 // We expect all but the last table to match.
46 array_pop($db_tables);
47 $this->assertEquals($db_tables, $expanded_db_tables);
51 * Tests drush_sql_filter_tables().
53 * @see drush_sql_filter_tables().
55 public function testFilterTables()
57 // Array of tables to search for.
62 // Mock array of tables to test with.
78 $actual_result = $this->filterTables($wildcard_input, $db_tables);
79 $this->assertEquals($expected_result, $actual_result);