在我的Laravel项目中更新了Composer之后,我的所有测试都失败了.我的Laravel版本是9.24.0
我在高山Linux映像(php:8.1-fpm-alpine
)上的Docker容器中使用PHPUnit测试.
pdo_sqlite
和sqlite3
php模块都被启用和加载(php -m
说).
当我运行docker-compose run --rm phpunit
时,我得到的所有测试结果如下:
Domain\Customer\Tests\Address\AddressModelTest::myTestName
Illuminate\Database\QueryException: SQLSTATE[HY000]:
General error: 1 near "0": syntax error (SQL: CREATE TABLE ...
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:759
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:719
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:545
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:109
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:394
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:241
/var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:338
/var/www/html/database/migrations/2021_11_17_154600_alter_table_modify_content_column_type.php:18
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:482
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:400
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:409
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:210
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php:36
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:740
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:210
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:175
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:118
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:87
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:616
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:99
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:651
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:139
/var/www/html/vendor/symfony/console/Command/Command.php:308
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:124
/var/www/html/vendor/symfony/console/Application.php:998
/var/www/html/vendor/symfony/console/Application.php:299
/var/www/html/vendor/symfony/console/Application.php:171
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:102
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:194
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:263
/var/www/html/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:286
/var/www/html/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:465
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php:80
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php:47
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php:22
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:123
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:92
/var/www/html/tests/MultitenancyTestCase.php:34
Caused by
PDOException: SQLSTATE[HY000]: General error: 1 near "0": syntax error
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:538
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:752
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:719
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:545
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:109
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:394
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:241
/var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:338
/var/www/html/database/migrations/2021_11_17_154600_alter_table_modify_content_column_type.php:18
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:482
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:400
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:409
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:210
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php:36
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:740
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:210
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:175
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:118
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:87
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:616
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:99
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:651
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:139
/var/www/html/vendor/symfony/console/Command/Command.php:308
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:124
/var/www/html/vendor/symfony/console/Application.php:998
/var/www/html/vendor/symfony/console/Application.php:299
/var/www/html/vendor/symfony/console/Application.php:171
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:102
/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:194
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:263
/var/www/html/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:286
/var/www/html/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:465
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php:80
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php:47
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php:22
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:123
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:92
/var/www/html/tests/MultitenancyTestCase.php:34
UPDATE:个
2021_11_17_154600_alter_table_modify_content_column_type.php
文件的内容为:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('menu_contents', function (Blueprint $table) {
$table->mediumText('content')->change();
}); # this is the 18. line
我试着调低laravel/framework:9.3.0
分,但没用.
你知道我怎么才能解决这个问题吗?