Попытка установить CodeCeption с фреймворком Laravel 5.6
Я получаю эту ошибку.
Шаги, которые я выполнил для установки: 1. композитор требует codeception / codeception --dev 2. Загрузочный файл php ./vendor/bin/codecept
Я получаю ошибку
Fatal error: Declaration of Codeception\Test\Unit::getDependencies() must be compatible with PHPUnit\Framework\TestCase::getDependencies(): array in /vendor/codeception/codeception/src/Codeception/Test/Unit.php on line 14
Может кто-нибудь сказать, как исправить это или перейти на более раннюю версию и заставить его работать с Laravel 5.6?






В строке Codeception / Test / Unit.php № 133 измените функцию getDependencies, чтобы она имела тип возвращаемого значения. : array
После изменения функция getDependencies должна выглядеть так.
public function getDependencies(): array
{
$names = [];
foreach ($this->getMetadata()->getDependencies() as $required) {
if ((strpos($required, ':') === false) and method_exists($this, $required)) {
$required = get_class($this) . ":$required";
}
$names[] = $required;
}
return $names;
}
Это было просто исправлено в codeception/codeception версии 2.4.5, поэтому запустите composer update, и ошибка больше не должна возникать.
Из журнала изменений (мой акцент):
2.4.5
- Fixed PHPUnit 7.2 compatibility.
- Introduced RunBefore extension to execute scripts before running tests. See #5049 by @aashmelev.
- [Db] Added two options for MySQL by @bangertz
ssl_cipher- list of one or more permissible ciphers to use for SSL encryptionssl_verify_server_cert- disables certificate CN verification- [Db] Always disconnect before connect when
reconnectis set. By @ashnazg- [Db] More explicit PDO closing upon destruction and close opened transactions by @ashnazg.
- [Recorder Extension] Improved error logging by @OneEyedSpaceFish. See #5101
- [Lumen] Fixed file uploads via REST module. By @retnek.
- Fixed: function getMetadata() may not exist, results in fatal error. See #4913 by @marcovtwout