0

「SiteController」というコントローラーがあります。その上に、フロントページを表示する通常の indexAction があります。これをテストするのはかなり簡単ですが、パラメーターを使用したアクションではない別の関数をテストするにはどうすればよいでしょうか。「sendMail($to, $message)」という関数があるとします。それをテストするにはどうすればよいですか?

<?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 をテストするにはどうすればよいですか?

4

1 に答える 1