从 10.x 升级到 11.x 后,Laravel Dusk 测试用例失败

问题描述 投票:0回答:1

我已将 Laravel 从 10.x 升级到 11.x,升级后我的所有 Dusk 测试用例均失败并出现以下错误

Received Mockery_1_Illuminate_Console_OutputStyle::askQuestion(), but no expectations were specified

  at vendor\symfony\console\Style\SymfonyStyle.php:231
    227▕     }
    228▕
    229▕     public function confirm(string $question, bool $default = true): bool
    230▕     {
  ➜ 231▕         return $this->askQuestion(new ConfirmationQuestion($question, $default));
    232▕     }
    233▕
    234▕     public function choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false): mixed
    235▕     {

  1   vendor\symfony\console\Style\SymfonyStyle.php:231
  2   vendor\laravel\framework\src\Illuminate\Console\Concerns\InteractsWithIO.php:142

我已经尝试将以下软件包升级到今天的最新版本,但它仍然给我同样的错误。

"laravel/framework": "^11.21",
"laravel/dusk": "^8.2.4",
"mockery/mockery": "^1.6.12",

有想过为什么会出现这个错误吗?

php laravel-dusk laravel-11
1个回答
0
投票

可能是缓存问题,尝试运行

php artisan optimize:clear

有关更多信息,请查看此讨论

© www.soinside.com 2019 - 2024. All rights reserved.