Skip to content

Commit 4a11785

Browse files
committed
Fix failing tests
1 parent f998279 commit 4a11785

File tree

29 files changed

+46
-46
lines changed

29 files changed

+46
-46
lines changed

src/generator/default/dbmodel.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
*/
5050
abstract class <?= $model->getClassName() ?> extends \yii\db\ActiveRecord
5151
{
52-
<?php if($scenarios = $model->getScenarios()):
53-
foreach($scenarios as $scenario): ?>
52+
<?php if ($scenarios = $model->getScenarios()):
53+
foreach ($scenarios as $scenario): ?>
5454
/**
5555
*<?= $scenario['description'] ?>
5656

@@ -76,7 +76,7 @@ public static function tableName()
7676
{
7777
return <?= var_export($model->getTableAlias()) ?>;
7878
}
79-
<?php if($scenarios): ?>
79+
<?php if ($scenarios): ?>
8080

8181
/**
8282
* Automatically generated scenarios from the model 'x-scenarios'.
@@ -92,7 +92,7 @@ public function scenarios()
9292
$default = parent::scenarios()[self::SCENARIO_DEFAULT];
9393

9494
return [
95-
<?php foreach($scenarios as $scenario): ?>
95+
<?php foreach ($scenarios as $scenario): ?>
9696
self::<?= $scenario['const'] ?> => $default,
9797
<?php endforeach; ?>
9898
/**

tests/specs/blog/migrations/m200000_000002_create_table_blog_posts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ public function up()
1111
0 => 'uid varchar(128) NOT NULL',
1212
'title' => $this->string(255)->notNull(),
1313
'slug' => $this->string(200)->null()->defaultValue(null),
14-
'category_id' => $this->integer()->notNull(),
14+
'category_id' => $this->integer()->notNull()->comment('Category of posts'),
1515
'active' => $this->boolean()->notNull()->defaultValue(false),
1616
'created_at' => $this->date()->null()->defaultValue(null),
17-
'created_by_id' => $this->integer()->null()->defaultValue(null),
17+
'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'),
1818
]);
1919
$this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid');
2020
$this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true);

tests/specs/blog/migrations/m200000_000004_create_table_post_comments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public function up()
99
{
1010
$this->createTable('{{%post_comments}}', [
1111
'id' => $this->bigPrimaryKey(),
12-
'post_id' => $this->string(128)->notNull(),
13-
'author_id' => $this->integer()->notNull(),
12+
'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'),
13+
'author_id' => $this->integer()->notNull()->comment('The User'),
1414
0 => 'message json NOT NULL',
1515
1 => 'meta_data json NOT NULL',
1616
'created_at' => $this->integer()->notNull(),

tests/specs/blog/migrations_maria_db/m200000_000002_create_table_blog_posts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ public function up()
1111
0 => 'uid varchar(128) NOT NULL',
1212
'title' => $this->string(255)->notNull(),
1313
'slug' => $this->string(200)->null()->defaultValue(null),
14-
'category_id' => $this->integer()->notNull(),
14+
'category_id' => $this->integer()->notNull()->comment('Category of posts'),
1515
'active' => $this->boolean()->notNull()->defaultValue(false),
1616
'created_at' => $this->date()->null()->defaultValue(null),
17-
'created_by_id' => $this->integer()->null()->defaultValue(null),
17+
'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'),
1818
]);
1919
$this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid');
2020
$this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true);

tests/specs/blog/migrations_maria_db/m200000_000004_create_table_post_comments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public function up()
99
{
1010
$this->createTable('{{%post_comments}}', [
1111
'id' => $this->bigPrimaryKey(),
12-
'post_id' => $this->string(128)->notNull(),
13-
'author_id' => $this->integer()->notNull(),
12+
'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'),
13+
'author_id' => $this->integer()->notNull()->comment('The User'),
1414
0 => 'message json NOT NULL DEFAULT \'[]\'',
1515
1 => 'meta_data json NOT NULL DEFAULT \'[]\'',
1616
'created_at' => $this->integer()->notNull(),

tests/specs/blog/migrations_mysql_db/m200000_000002_create_table_blog_posts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ public function up()
1111
0 => 'uid varchar(128) NOT NULL',
1212
'title' => $this->string(255)->notNull(),
1313
'slug' => $this->string(200)->null()->defaultValue(null),
14-
'category_id' => $this->integer()->notNull(),
14+
'category_id' => $this->integer()->notNull()->comment('Category of posts'),
1515
'active' => $this->boolean()->notNull()->defaultValue(false),
1616
'created_at' => $this->date()->null()->defaultValue(null),
17-
'created_by_id' => $this->integer()->null()->defaultValue(null),
17+
'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'),
1818
]);
1919
$this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid');
2020
$this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true);

tests/specs/blog/migrations_mysql_db/m200000_000004_create_table_post_comments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public function up()
99
{
1010
$this->createTable('{{%post_comments}}', [
1111
'id' => $this->bigPrimaryKey(),
12-
'post_id' => $this->string(128)->notNull(),
13-
'author_id' => $this->integer()->notNull(),
12+
'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'),
13+
'author_id' => $this->integer()->notNull()->comment('The User'),
1414
0 => 'message json NOT NULL',
1515
1 => 'meta_data json NOT NULL',
1616
'created_at' => $this->integer()->notNull(),

tests/specs/blog/migrations_pgsql_db/m200000_000002_create_table_blog_posts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ public function safeUp()
1111
0 => '"uid" varchar(128) NOT NULL',
1212
'title' => $this->string(255)->notNull(),
1313
'slug' => $this->string(200)->null()->defaultValue(null),
14-
'category_id' => $this->integer()->notNull(),
14+
'category_id' => $this->integer()->notNull()->comment('Category of posts'),
1515
'active' => $this->boolean()->notNull()->defaultValue(false),
1616
'created_at' => $this->date()->null()->defaultValue(null),
17-
'created_by_id' => $this->integer()->null()->defaultValue(null),
17+
'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'),
1818
]);
1919
$this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid');
2020
$this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true);

tests/specs/blog/migrations_pgsql_db/m200000_000004_create_table_post_comments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public function safeUp()
99
{
1010
$this->createTable('{{%post_comments}}', [
1111
'id' => $this->bigPrimaryKey(),
12-
'post_id' => $this->string(128)->notNull(),
13-
'author_id' => $this->integer()->notNull(),
12+
'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'),
13+
'author_id' => $this->integer()->notNull()->comment('The User'),
1414
0 => '"message" json NOT NULL DEFAULT \'[]\'',
1515
1 => '"meta_data" json NOT NULL DEFAULT \'[]\'',
1616
'created_at' => $this->integer()->notNull(),

tests/specs/blog_v2/migrations_maria_db/m200000_000005_change_table_v2_comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function up()
99
{
1010
$this->dropForeignKey('fk_v2_comments_post_id_v2_posts_uid', '{{%v2_comments}}');
1111
$this->dropForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}');
12-
$this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id'));
12+
$this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id')->comment('The User'));
1313
$this->dropColumn('{{%v2_comments}}', 'author_id');
1414
$this->alterColumn('{{%v2_comments}}', 'message', $this->text()->notNull());
1515
$this->alterColumn('{{%v2_comments}}', 'meta_data', $this->string(300)->null()->defaultValue(''));

0 commit comments

Comments
 (0)