Unit testing Codeception:在测试中使用REST模块
我在\tests\unit\ReportTest.php中有这段代码:Unit testing Codeception:在测试中使用REST模块,unit-testing,laravel-5.1,codeception,Unit Testing,Laravel 5.1,Codeception,我在\tests\unit\ReportTest.php中有这段代码: class ReportTest extends \Codeception\TestCase\Test { protected function _before() { Auth::attempt(['email' => $this->valid_email, 'password' => $this->valid_password]); } prot
class ReportTest extends \Codeception\TestCase\Test
{
protected function _before()
{
Auth::attempt(['email' => $this->valid_email, 'password' => $this->valid_password]);
}
protected function _after()
{
}
public function testMe()
{
$this->sendGet(route('index'));
$this->canSeeResponseCodeIs(200);
}
}
我的问题是方法$this->sendGet()
和$this->canseesresponsecodeis()
没有定义,我对使用Codeception有点陌生,所以请大家耐心听我说
这是我的unit.suite.yml
:
class_name: UnitTester
modules:
enabled:
- Asserts
- \Helper\Unit
- Laravel5
- REST:
depends: PhpBrowser
config:
Laravel5:
environment_file: .env
我想使用REST模块,但我无法让它工作。使用REST模块时使用CEST似乎比使用TEST更好