Sit*_*per 3 php codeception laravel-5.1
当我在 Laravel 中的 Codeception 中运行功能测试时,我时不时会收到错误:
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Exception::getStatusCode()
Run Code Online (Sandbox Code Playgroud)
这些是我的配置:
codeception.yml
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
extensions:
enabled:
- Codeception\Extension\RunFailed
modules:
config:
Db:
dsn: 'mysql:host=127.0.0.1;port=3306;dbname=la51'
user: 'root'
password: 'root'
populate: false
cleanup: false
reconnect: true
Run Code Online (Sandbox Code Playgroud)
功能.suite.yml
class_name: FunctionalTester
modules:
enabled:
# add framework module here
- \Helper\Functional
- Asserts
- Db
- Laravel5
config:
Laravel5:
cleanup: false
Run Code Online (Sandbox Code Playgroud)
这是当我“codecept run”时我在终端中得到的结果:
Rubens-MacBook-Pro:la51 rubenbijker$ codecept run -vvv
Codeception PHP Testing Framework v2.1.3
Powered by PHPUnit 4.8.10 by Sebastian Bergmann and contributors.
Acceptance Tests (0) ------------------------
Modules: PhpBrowser, \Helper\Acceptance
---------------------------------------------
---------------------------------------------
Functional Tests (9) -------------------------------------------------------------------------------------------------------------------------------
Modules: \Helper\Functional, Asserts, Db, Laravel5
----------------------------------------------------------------------------------------------------------------------------------------------------
Create a boat (AdminCreatesBoatCept)
Scenario:
* As an a guest
* I am on page ""
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Exception::getStatusCode()
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Exception::getStatusCode()
FATAL ERROR. TESTS NOT FINISHED.
Call to undefined method Exception::getStatusCode()
in /Applications/MAMP/htdocs/la51/app/Exceptions/Handler.php:71
Rubens-MacBook-Pro:la51 rubenbijker$
Run Code Online (Sandbox Code Playgroud)
我报告了 Codeception 的问题,但他们说这是 Laravel 错误,所以他们无法帮助我。这是由于我的代码中的错误引起的吗?或者 Codeception 和 Laravel 之间的配置错误?