在larvel 5.7上运行。我创建了用于身份验证的特定上下文,但是遇到了问题,并且behat似乎找不到该类。
这是我的结构和配置的样子:
// behat.yml
default:
suites:
user:
paths: [ '%paths.base%/tests/Feature/Auth/features' ]
contexts: [ Tests\Feature\Auth\AuthFeatureContext ]
上下文文件
// tests/Feature/Auth/AuthFeatureContext.php
<?php
namespace Tests\Feature\Auth;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
class ApiFeatureContext implements Context, SnippetAcceptingContext
{
}
功能文件
// tests/Feature/Auth/features/authentication.feature
Feature: Authentication
In order to gain access to the site management area
As an admin
I need to be able to login and logout
Scenario: Logging in
Given I am on "/"
我在composer.json中有这个
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
正在运行的behat返回此错误:
找不到
Tests\Feature\Auth\AuthFeatureContext
上下文类,并且 不能使用。