/**
* Tests the temporary query functionality.
*
* @group Database
*/
class TemporaryQueryTest extends TemporaryQueryTestBase
{ /**
* Confirms that temporary tables work.
*/
public function testTemporaryQuery() { parent::
testTemporaryQuery();
$connection =
$this->
getConnection();
$table_name_test =
$connection->
queryTemporary('SELECT [name] FROM {test}',
[]);
// Assert that the table is indeed a temporary one.
$temporary_table_info =
$connection->
query("SHOW CREATE TABLE {" .
$table_name_test . "}"
)->
fetchAssoc();
$this->
stringContains($temporary_table_info["Create Table"
], "CREATE TEMPORARY TABLE"
);
// Assert that both have the same field names.
$normal_table_fields =
$connection->
query("SELECT * FROM {test}"
)->
fetch();