我是测试的新手 . 我正在尝试使用Laracasts / Integrated测试登录
/** @test */
public function it_should_login_user()
{
$credentials = [
'email' => 'jghenonig@gmail.com',
'password' => '12345'
];
$this->visit('/auth/login')
->submitForm('Login', $credentials)
->andSee('Dashboard')->onPage('/');
}
我有一个带有图例“Dashboard”的H1 Headers ,但是我收到了这个错误
1)ExampleTest :: it_should_login_user对'http://localhost/auth/login'的GET请求失败 . 得到500代码 .
/Users/marionava/Code/ilencuentro/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php第47行的PDOException
你可以帮帮我吗?
1 回答
我使用TestCase文件上的方法调用
be()
解决了这个问题 . 然后我用它创建一个登录方法,这就是全部 .然后我在我需要的地方使用这种方法 .