2010年5月6日星期四

Re: [fw-mvc] Re: PHPUnit testing generating Zend_Dom_Exception

There's an easy way to verify that your code is working correctly, by adding the following asserts to each controllertest

$this->assertNotController('error'); // or whatever controller you use for handling errors
$this->assertNotAction('error'); // or whatever action you use for handling errors

Just a quick pro-tip to see your tests are working on expected results and not on the error handler of your project

On 06 May 2010, at 09:58, SteveG-UK wrote:

>
> Thanks for your help.
>
> I mangaed to find the problem by using the bold code below :-
>
> public function testAddAction(){
> $this->dispatch('/unit/add');
>
> print_r($this->getResponse());
> die();
>
> $this->assertResponseCode('200');
> $this->assertQuery('form-test');
> }
>
> This displayed an error sayng that I had use mktime() rather than time()
> (mktime is depreciated). I guess this was causing DOM problems.
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/PHPUnit-testing-generating-Zend-Dom-Exception-tp2130849p2132212.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>

没有评论: