Answer the question
In order to leave comments, you need to log in
Why doesn't codeception see the temporary table?
I'm testing a class for batch insertion into the database.
I create a temporary table for the test (in setUp or in the test method, it doesn't matter)
Yii::$app->db->createCommand(
'CREATE TEMPORARY TABLE {{%table_loading}} SELECT * FROM {{%table}} LIMIT 0'
)->execute();
$I->canSeeInDatabase('table_loading', ['brand_name'=>'brand_1', 'article_name'=>'article_1', 'no_in_part'=>1]);
Base table or view not found: 1146 Table 'mydatabase.table_loading' doesn't exist
Answer the question
In order to leave comments, you need to log in
If we are talking about Yii2, Codeception for connecting the database inherits the Yii config, redefining only dsn (the name of the test base, see tests/codeception/config/config.php). In this case, the simplest thing is to stick a debugger after CREATE TEMPORARY TABLE and see where the table is being created.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question