Skip to content

Commit 3715ff2

Browse files
committed
Fix failing test: testCreateMigrationForDropTable132IndependentTablesDropSort
1 parent c47deb8 commit 3715ff2

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

tests/specs/issue_fix/132_create_migration_for_drop_table/case_independent_tables_drop_sort/mysql/models/base/Bigpk.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?php
22

3+
/**
4+
* This file is generated by Gii, do not change manually!
5+
*/
6+
37
namespace app\models\base;
48

59
/**
6-
*
10+
* This is the model class for table "bigpks".
711
*
812
* @property integer $id
913
* @property string $name

tests/specs/issue_fix/132_create_migration_for_drop_table/case_independent_tables_drop_sort/mysql/models/base/Foo.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
/**
4+
* This file is generated by Gii, do not change manually!
5+
*/
6+
37
namespace app\models\base;
48

59
/**

tests/specs/issue_fix/132_create_migration_for_drop_table/case_independent_tables_drop_sort/mysql/models/base/Ubigpk.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?php
22

3+
/**
4+
* This file is generated by Gii, do not change manually!
5+
*/
6+
37
namespace app\models\base;
48

59
/**
6-
*
10+
* This is the model class for table "ubigpks".
711
*
812
* @property string $id
913
* @property string $name

tests/specs/issue_fix/132_create_migration_for_drop_table/case_independent_tables_drop_sort/mysql/models/base/Upk.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?php
22

3+
/**
4+
* This file is generated by Gii, do not change manually!
5+
*/
6+
37
namespace app\models\base;
48

59
/**
6-
*
10+
* This is the model class for table "upks".
711
*
812
* @property integer $id
913
* @property string $name

tests/unit/IssueFixTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,13 @@ public function testNullableFalseInRequired()
243243
public function testCreateMigrationForDropTable132IndependentTablesDropSort()
244244
{
245245
$testFile = Yii::getAlias("@specs/issue_fix/132_create_migration_for_drop_table/case_independent_tables_drop_sort/index.php");
246+
$dropTables = function () {
247+
Yii::$app->db->createCommand('DROP TABLE IF EXISTS {{%ubigpks}}')->execute();
248+
Yii::$app->db->createCommand('DROP TABLE IF EXISTS {{%bigpks}}')->execute();
249+
Yii::$app->db->createCommand('DROP TABLE IF EXISTS {{%upks}}')->execute();
250+
};
246251

252+
$dropTables();
247253
Yii::$app->db->createCommand()->createTable('{{%upks}}', [
248254
'id' => 'upk',
249255
'name' => 'string(150)',
@@ -268,9 +274,7 @@ public function testCreateMigrationForDropTable132IndependentTablesDropSort()
268274
]);
269275
$this->checkFiles($actualFiles, $expectedFiles);
270276

271-
Yii::$app->db->createCommand('DROP TABLE IF EXISTS {{%ubigpks}}')->execute();
272-
Yii::$app->db->createCommand('DROP TABLE IF EXISTS {{%bigpks}}')->execute();
273-
Yii::$app->db->createCommand('DROP TABLE IF EXISTS {{%upks}}')->execute();
277+
$dropTables();
274278
}
275279

276280
// Create migration for drop table if a entire schema is deleted from OpenAPI spec #132

0 commit comments

Comments
 (0)