追加/削除など、Cake によって作成された関数もテストする必要があると言われました...
このような関数がある場合、リターン、リダイレクト、またはビューさえない場合、どうすればテストできますか? (私はそれを実行するためにajaxを使用します)
public function add() {
if ($this->request->is('post')) {
$this->Comment->create();
if ($this->Comment->save($this->request->data)) {
$this->Session->setFlash(__('The comment has been saved'));
} else {
$this->Session->setFlash(__('The comment could not be saved. Please, try again.'));
}
}
}
ありがとう