Testing: Target class [config] does not exist
Нужно протестировать функционал входа в админку и создания товара.
Вышло так:
public function testExample() {
$user = User::find(1);
$this->post(route('login'), [
'email' => '[email protected]',
'password' => 'ghsgdsfgfg',
]);
$this->assertAuthenticatedAs($user);
$this->post(route('marks.store'), [
'name' => 'mark1',
'alias' => 'mark1'
]);
$this->assertDatabaseHas('marks',['name' => 'mark1']);
}
в результате ошибка:
PHPUnit 8.5.5 by Sebastian Bergmann and contributors.
..array:2 [
0 => "admin"
1 => "marks"
]
There was 1 error:
1) Tests\Feature\NewTest::testExample
Illuminate\Contracts\Container\BindingResolutionException: Target class [config] does not exist.
Почему указывает на config ?
1е утверждение срабатывает assertAuthenticatedAs, второе нет
Миграция
public function up()
{
Schema::create('marks', function (Blueprint $table) {
$table->id();
$table->string('name',30);
$table->string('alias',30)->nullable();
$table->boolean('published')->default(true);
$table->timestamps();
});
}