Skip to content

Commit

Permalink
Fixed yiisoft#10969: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pana1990 committed Feb 26, 2016
1 parent 921b102 commit 03cb361
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/framework/console/controllers/MigrateControllerTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,38 @@ public function down()
}
}
CODE;
$this->assertEqualsWithoutLE($code, $file);

$class = 'm' . gmdate('ymd_His') . '_' . $migrationName;
$this->runMigrateControllerAction('create', [
$migrationName,
'fields' => 'id:primaryKey,address:string,address2:string,email:string',
]);
$file = $this->parseNameClassMigration($class);
$code = <<<CODE
<?php
use yii\db\Migration;
class {$class} extends Migration
{
public function up()
{
\$this->createTable('test', [
'id' => \$this->primaryKey(),
'address' => \$this->string(),
'address2' => \$this->string(),
'email' => \$this->string()
]);
}
public function down()
{
\$this->dropTable('test');
}
}
CODE;
$this->assertEqualsWithoutLE($code, $file);
}
Expand Down

0 comments on commit 03cb361

Please sign in to comment.