yii2: Tests. Something wrong happened

What steps will reproduce the problem?

run PHPUnit test with this config (with fix #15244 /optional/ and #15246)

What is the expected result?

no F in output

What do you get instead?

Time: 18.63 minutes, Memory: 90.00MB

There were 7 failures:

1) yiiunit\framework\caching\DbCacheTest::testExpireAdd
Failed asserting that false is true.

/var/www/html/tests/framework/caching/DbCacheTest.php:98
/var/www/html/vendor/phpunit/phpunit/phpunit:52

2) yiiunit\framework\caching\DbCacheTest::testSet
Failed asserting that false is true.

/var/www/html/tests/framework/caching/CacheTestCase.php:89
/var/www/html/vendor/phpunit/phpunit/phpunit:52

3) yiiunit\framework\db\mysql\SchemaTest::testTableSchemaConstraints with data set "3: foreign key" ('T_constraints_3', 'foreignKeys', array(yii\db\ForeignKeyConstraint Object (...)))
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    '{"columnNames":["C_fk_id_1","C_fk_id_2"],"foreignColumnNames":["C_id_1","C_id_2"],"foreignTableName":"t_constraints_2","onDelete":"CASCADE","onUpdate":"CASCADE"}' => yii\db\ForeignKeyConstraint Object (...)
+    '{"columnNames":["C_fk_id_1","C_fk_id_2"],"foreignColumnNames":["c_id_1","c_id_2"],"foreignTableName":"t_constraints_2","onDelete":"CASCADE","onUpdate":"CASCADE"}' => yii\db\ForeignKeyConstraint Object (...)
 )

/var/www/html/tests/framework/db/SchemaTest.php:732
/var/www/html/tests/framework/db/SchemaTest.php:681
/var/www/html/vendor/phpunit/phpunit/phpunit:52

4) yiiunit\framework\db\mysql\SchemaTest::testTableSchemaConstraintsWithPdoUppercase with data set "3: foreign key" ('T_constraints_3', 'foreignKeys', array(yii\db\ForeignKeyConstraint Object (...)))
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    '{"columnNames":["C_fk_id_1","C_fk_id_2"],"foreignColumnNames":["C_id_1","C_id_2"],"foreignTableName":"t_constraints_2","onDelete":"CASCADE","onUpdate":"CASCADE"}' => yii\db\ForeignKeyConstraint Object (...)
+    '{"columnNames":["C_fk_id_1","C_fk_id_2"],"foreignColumnNames":["c_id_1","c_id_2"],"foreignTableName":"t_constraints_2","onDelete":"CASCADE","onUpdate":"CASCADE"}' => yii\db\ForeignKeyConstraint Object (...)
 )

/var/www/html/tests/framework/db/SchemaTest.php:732
/var/www/html/tests/framework/db/SchemaTest.php:699
/var/www/html/vendor/phpunit/phpunit/phpunit:52

5) yiiunit\framework\db\mysql\SchemaTest::testTableSchemaConstraintsWithPdoLowercase with data set "3: foreign key" ('T_constraints_3', 'foreignKeys', array(yii\db\ForeignKeyConstraint Object (...)))
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    '{"columnNames":["C_fk_id_1","C_fk_id_2"],"foreignColumnNames":["C_id_1","C_id_2"],"foreignTableName":"t_constraints_2","onDelete":"CASCADE","onUpdate":"CASCADE"}' => yii\db\ForeignKeyConstraint Object (...)
+    '{"columnNames":["C_fk_id_1","C_fk_id_2"],"foreignColumnNames":["c_id_1","c_id_2"],"foreignTableName":"t_constraints_2","onDelete":"CASCADE","onUpdate":"CASCADE"}' => yii\db\ForeignKeyConstraint Object (...)
 )

/var/www/html/tests/framework/db/SchemaTest.php:732
/var/www/html/tests/framework/db/SchemaTest.php:717
/var/www/html/vendor/phpunit/phpunit/phpunit:52

6) Warning
The data provider specified for yiiunit\framework\db\oci\QueryBuilderTest::testBuildLikeCondition is invalid.
Connection::dsn cannot be empty.

/var/www/html/vendor/phpunit/phpunit/phpunit:52

7) yiiunit\framework\db\pgsql\SchemaTest::testColumnSchema
defaultValue of column smallint_col does not match.
Failed asserting that '1' is identical to 1.

/var/www/html/tests/framework/db/SchemaTest.php:488
/var/www/html/vendor/phpunit/phpunit/phpunit:52

FAILURES!
Tests: 5344, Assertions: 21338, Failures: 7, Skipped: 1533, Incomplete: 4.

Additional info

Q A
Yii version 2.0.14-dev
PHP version 7.1.12
Operating system Debian

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

@schmunk42 you tell about

MySQL 5.7.20 (fail) https://gitlab.com/yiisoft/yii2/-/jobs/42465356

There was 1 error:

1) yiiunit\framework\db\mysql\QueryBuilderTest::testCreateTableColumnTypes
yii\db\Exception: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'col59'
The SQL being executed was: CREATE TABLE `column_type_table` (
	`col1` bigint(20),
	`col2` bigint(20) NOT NULL,
	`col3` bigint(20) CHECK (`col3` > 5),
	`col4` bigint(8),
	`col5` bigint(8) CHECK (`col5` > 5),
	`col6` blob,
	`col7` tinyint(1) NOT NULL DEFAULT 1,
	`col8` tinyint(1),
	`col9` char(1) CHECK (`col9` LIKE "test%"),
	`col10` char(1) NOT NULL,
	`col11` char(6) CHECK (`col11` LIKE "test%"),
	`col12` char(6),
	`col13` char(1),
	`col14` date NOT NULL,
	`col15` date,
	`col16` datetime NOT NULL,
	`col17` datetime,
	`col18` decimal(10,0) CHECK (`col18` > 5.6),
	`col19` decimal(10,0) NOT NULL,
	`col20` decimal(12,4) CHECK (`col20` > 5.6),
	`col21` decimal(12,4),
	`col22` decimal(10,0),
	`col23` double CHECK (`col23` > 5.6),
	`col24` double NOT NULL,
	`col25` double CHECK (`col25` > 5.6),
	`col26` double,
	`col27` double,
	`col28` float CHECK (`col28` > 5.6),
	`col29` float NOT NULL,
	`col30` float CHECK (`col30` > 5.6),
	`col31` float,
	`col32` float,
	`col33` int(11) CHECK (`col33` > 5),
	`col34` int(11) NOT NULL,
	`col35` int(8) CHECK (`col35` > 5),
	`col36` int(8),
	`col37` int(11),
	`col38` decimal(19,4) CHECK (`col38` > 0.0),
	`col39` decimal(19,4) NOT NULL,
	`col40` decimal(16,2) CHECK (`col40` > 0.0),
	`col41` decimal(16,2),
	`col42` decimal(19,4),
	`col43` smallint(8),
	`col44` smallint(6),
	`col45` varchar(255) CHECK (`col45` LIKE "test%"),
	`col46` varchar(255) NOT NULL,
	`col47` varchar(32) CHECK (`col47` LIKE "test%"),
	`col48` varchar(32),
	`col49` varchar(255),
	`col50` text CHECK (`col50` LIKE "test%"),
	`col51` text NOT NULL,
	`col52` text CHECK (`col52` LIKE "test%"),
	`col53` text NOT NULL,
	`col54` text,
	`col55` text,
	`col56` time NOT NULL,
	`col57` time,
	`col58` timestamp NOT NULL,
	`col59` timestamp,
	`col60` timestamp NULL DEFAULT NULL,
	`col61` int(11) COMMENT 'test comment'
)

/project/framework/db/Schema.php:595
/project/framework/db/Command.php:1004
/project/tests/framework/db/QueryBuilderTest.php:1044
/project/vendor/phpunit/phpunit/phpunit:52

Caused by
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'col59'

/project/framework/db/Command.php:994
/project/tests/framework/db/QueryBuilderTest.php:1044
/project/vendor/phpunit/phpunit/phpunit:52