Sorry für vielleicht dumme Frage, aber ich kann keine Antwort durch googlen finden.codeception Abnahmetest mit Fixtures in yii2
Meine Frage ist: Ich erstellte Datei TaskCest.php unter Annahme Backend \, die in dieser Datei Erklärung folgende haben
use yii\test\FixtureTrait;
public function fixtures() {
return ['tasks' => TasksFixture::className()];
}
ich mit Daten in Datenverzeichnis, dass die Befestigungs Klasse.
Aber wenn ich Skript ausführen ich folgende Fehlermeldung erhalten:
[yii\base\ErrorException] ltrim() expects parameter 1 to be string, object given
Fehler liegt auf der Hand, aber ich kann nicht verstehen, in der Datei yii2 \ test \ FixtureTrait.php: 145 I Funktion haben, die Parameter name erwartet zu sein String aber Objekt wird automatisch übergeben [Ich rufe getFixture nicht an]. Was ist das Problem? Hatte jemand dasselbe gesehen?
-vvv Ausgang
Test-Tests/Annahme/TaskCest.php: getFixture
[yii\base\ErrorException] ltrim() expects parameter 1 to be string, object given
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/Lib/Di.php:123
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/Lib/Di.php:123
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/Test/Cest.php:136
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/Test/Cest.php:148
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/Test/Cest.php:82
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/Test/Test.php:90
/home/nginx/www/planning-back/vendor/phpunit/phpunit/src/Framework/TestSuite.php:728
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/PHPUnit/Runner.php:98
/home/nginx/www/planning-back/vendor/codeception/codeception/src/Codeception/SuiteManager.php:154
/home/velaro/.config/composer/vendor/codeception/codeception/src/Codeception/Codecept.php:183
/home/velaro/.config/composer/vendor/codeception/codeception/src/Codeception/Codecept.php:152
/home/velaro/.config/composer/vendor/codeception/codeception/src/Codeception/Command/Run.php:282
/home/velaro/.config/composer/vendor/symfony/console/Command/Command.php:255
/home/velaro/.config/composer/vendor/symfony/console/Application.php:829
/home/velaro/.config/composer/vendor/symfony/console/Application.php:191
/home/velaro/.config/composer/vendor/symfony/console/Application.php:122
/home/velaro/.config/composer/vendor/codeception/codeception/src/Codeception/Application.php:103
/home/velaro/.config/composer/vendor/codeception/codeception/codecept:34
Kann Fehlerstack überprüfen oder einfügen? Ich kann nicht herausfinden, woher du das hast. – Bizley
Führen Sie die Codeception mit '--debug' für den Stack aus. – Bizley
es ist nur wie ich in roter Farbe, kein Stapel gedruckt, auch wenn ich mit Debug-Option – Velaro