0
"SiteController"라는 컨트롤러가 있습니다. 거기에 정상적인 indexAction이 FrontPage를 표시합니다. 이 테스트는 상당히 쉽지만 매개 변수가있는 작업이 아닌 다른 함수를 테스트하는 방법은 무엇입니까? "sendMail ($ to, $ message)"함수가 있다고 가정 해 봅시다. 어떻게 테스트합니까?PHPUnit 및 Zend : 컨트롤러에서 함수 테스트?
<?php
class ControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
{
public function testShowCallsServiceFind()
{
$this->dispatch('/index'); // dont care about this...
// what I need is a way to do this:
$res = $controller->sendMail("bla", "bla"); // so that I can test sendMail?
}
}
어떻게 sendmail을 테스트 할 수 있습니까? 당신은 실제로 해달라고