Symfony で json API の機能テストをいくつか作成しています。
オブジェクトを使用しsfTestFunctional
て結果をテストし、次の応答を検証します。
{
"result": true,
"content": [
"one",
"two"
]
}
次のようなもので:
$browser = new sfTestFunctional(new sfBrowser());
$browser->
get('/hi')->
with('response')->
begin()->
isStatusCode(200)->
matches('/result\"\: true/')->
matches('/one.*two/m')->
end()
今これは私が得るものです:
ok 1 - status code is 200
ok 2 - response content matches regex /result\\: true/"
not ok 3 - response content matches regex /one.*two/m
確かに、私は何か悪いことをしています。ヒントはありますか?