Skip to content

Commit b80fcd6

Browse files
committed
Change lot of tests 2 - Fix failing tests
1 parent ae7bbfb commit b80fcd6

File tree

26 files changed

+126
-92
lines changed

26 files changed

+126
-92
lines changed

tests/specs/blog/migrations_maria_db/m200000_000001_create_table_users.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public function up()
1212
'username' => $this->string(200)->notNull(),
1313
'email' => $this->string(200)->notNull(),
1414
'password' => $this->string()->notNull(),
15-
'role' => $this->string(20)->null()->defaultValue('reader'),
16-
'flags' => $this->integer()->null()->defaultValue(0),
17-
'created_at' => $this->timestamp()->null()->defaultExpression("(CURRENT_TIMESTAMP)"),
15+
'role' => $this->string(20)->notNull()->defaultValue('reader'),
16+
'flags' => $this->integer()->notNull()->defaultValue(0),
17+
'created_at' => $this->timestamp()->notNull()->defaultExpression("(CURRENT_TIMESTAMP)"),
1818
]);
1919
$this->createIndex('users_username_key', '{{%users}}', 'username', true);
2020
$this->createIndex('users_email_key', '{{%users}}', 'email', true);

tests/specs/blog/migrations_maria_db/m200000_000002_create_table_blog_posts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public function up()
1010
$this->createTable('{{%blog_posts}}', [
1111
0 => 'uid varchar(128) NOT NULL',
1212
'title' => $this->string(255)->notNull(),
13-
'slug' => $this->string(200)->null()->defaultValue(null),
13+
'slug' => $this->string(200)->notNull(),
1414
'category_id' => $this->integer()->notNull()->comment('Category of posts'),
1515
'active' => $this->boolean()->notNull()->defaultValue(false),
16-
'created_at' => $this->date()->null()->defaultValue(null),
17-
'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'),
16+
'created_at' => $this->date()->notNull(),
17+
'created_by_id' => $this->integer()->notNull()->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_000003_create_table_fakerable.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ public function up()
99
{
1010
$this->createTable('{{%fakerable}}', [
1111
'id' => $this->bigPrimaryKey(),
12-
'active' => $this->boolean()->null()->defaultValue(null),
13-
'floatval' => $this->float()->null()->defaultValue(null),
14-
'floatval_lim' => $this->float()->null()->defaultValue(null),
15-
'doubleval' => $this->double()->null()->defaultValue(null),
16-
'int_min' => $this->integer()->null()->defaultValue(3),
17-
'int_max' => $this->integer()->null()->defaultValue(null),
18-
'int_minmax' => $this->integer()->null()->defaultValue(null),
19-
'int_created_at' => $this->integer()->null()->defaultValue(null),
20-
'int_simple' => $this->integer()->null()->defaultValue(null),
21-
'str_text' => $this->text()->null()->defaultValue(null),
22-
'str_varchar' => $this->string(100)->null()->defaultValue(null),
23-
'str_date' => $this->date()->null()->defaultValue(null),
24-
'str_datetime' => $this->timestamp()->null()->defaultValue(null),
25-
'str_country' => $this->text()->null()->defaultValue(null),
12+
'active' => $this->boolean()->notNull(),
13+
'floatval' => $this->float()->notNull(),
14+
'floatval_lim' => $this->float()->notNull(),
15+
'doubleval' => $this->double()->notNull(),
16+
'int_min' => $this->integer()->notNull()->defaultValue(3),
17+
'int_max' => $this->integer()->notNull(),
18+
'int_minmax' => $this->integer()->notNull(),
19+
'int_created_at' => $this->integer()->notNull(),
20+
'int_simple' => $this->integer()->notNull(),
21+
'str_text' => $this->text()->notNull(),
22+
'str_varchar' => $this->string(100)->notNull(),
23+
'str_date' => $this->date()->notNull(),
24+
'str_datetime' => $this->timestamp()->notNull(),
25+
'str_country' => $this->text()->notNull(),
2626
]);
2727
}
2828

tests/specs/issue_fix/132_create_migration_for_drop_table/case_independent_tables_drop_sort/mysql/migrations_mysql_db/m200000_000001_create_table_foos.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->createTable('{{%foos}}', [
1111
'id' => $this->primaryKey(),
12-
'factor' => $this->integer()->null()->defaultValue(null),
12+
'factor' => $this->integer()->notNull(),
1313
]);
1414
}
1515

tests/specs/issue_fix/132_create_migration_for_drop_table/mysql/migrations_mysql_db/m200000_000000_create_table_foos.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->createTable('{{%foos}}', [
1111
'id' => $this->primaryKey(),
12-
'factor' => $this->integer()->null()->defaultValue(null),
12+
'factor' => $this->integer()->notNull(),
1313
]);
1414
}
1515

tests/specs/issue_fix/132_create_migration_for_drop_table/pgsql/migrations_pgsql_db/m200000_000000_create_table_foos.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function safeUp()
99
{
1010
$this->createTable('{{%foos}}', [
1111
'id' => $this->primaryKey(),
12-
'factor' => $this->integer()->null()->defaultValue(null),
12+
'factor' => $this->integer()->notNull(),
1313
]);
1414
}
1515

tests/specs/issue_fix/153_nullable_false_in_required/app/models/base/Pristine.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public function rules()
2424
{
2525
return [
2626
'billing_factor_default' => [['billing_factor'], 'default', 'value' => 100],
27-
'required' => [['billing_factor'], 'required'],
2827
'billing_factor_integer' => [['billing_factor'], 'integer'],
2928
];
3029
}

tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000000_create_table_accounts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function up()
1010
$this->createTable('{{%accounts}}', [
1111
'id' => $this->primaryKey(),
1212
'name' => $this->string(128)->notNull()->comment('account name'),
13-
'paymentMethodName' => $this->text()->null(),
13+
'paymentMethodName' => $this->text()->notNull(),
1414
]);
1515
}
1616

tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000001_create_table_contacts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public function up()
1010
$this->createTable('{{%contacts}}', [
1111
'id' => $this->primaryKey(),
1212
'account_id' => $this->integer()->notNull()->comment('Account'),
13-
'active' => $this->boolean()->null()->defaultValue(false),
14-
'nickname' => $this->text()->null(),
13+
'active' => $this->boolean()->notNull()->defaultValue(false),
14+
'nickname' => $this->text()->notNull(),
1515
]);
1616
$this->addForeignKey('fk_contacts_account_id_accounts_id', '{{%contacts}}', 'account_id', '{{%accounts}}', 'id');
1717
}

tests/specs/issue_fix/20_consider_openapi_spec_examples_in_faker_code_generation/mysql/migrations_mysql_db/m200000_000000_create_table_fruits.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->createTable('{{%fruits}}', [
1111
'id' => $this->primaryKey(),
12-
'name' => $this->text()->null(),
12+
'name' => $this->text()->notNull(),
1313
]);
1414
}
1515

0 commit comments

Comments
 (0)