【发布时间】:2013-11-22 01:48:32
【问题描述】:
我不明白如何进行功能测试。
我想通过运行简单的功能测试开始:
class PageTest extends FunctionalTest{
static $fixture_file = 'mysite/tests/PageTest.yml';
public function testDirectorView() {
$response1 = Director::test('/hello', null, null);
$this->assertTrue(
strpos(
$response1->getBody(),
'<h3>Hello World</h3>'
) !== false);
}
}
使用以下夹具
Page:
hello:
Title: HelloWorld
但是我的测试失败并且响应正文显示我正在获取 404。
我怎样才能正确获得页面响应/设置夹具?
【问题讨论】:
标签: testing silverstripe