public function testNonExistingTable() { $connectionCreator = new MySqlConnectionCreator(); $connection = $connectionCreator->createConnection(); $columnsProvider = new MySqlTableColumnsProvider($connection); $subject = new MySqlTablesProvider($columnsProvider); $subject->setConnection($connection)->setRootTableName('maker123'); $this->setExpectedException(\RuntimeException::class); $subject->getTables(); }
/** * @return \DatabaseExporterImporter\Model\DataProvider\MySQL\MySqlDataProvider */ private function getSubject() { $connectionCreator = new MySqlConnectionCreator(); $this->connection = $connectionCreator->createConnection(); $columnsProvider = new MySqlTableColumnsProvider($this->connection); $tablesProvider = new MySqlTablesProvider($columnsProvider); $tablesProvider->setConnection($this->connection); $subject = new MySqlDataProvider($tablesProvider); return $subject->setConnection($this->connection); }