2010年5月5日星期三

Re: [fw-mvc] PHPUnit testing generating Zend_Dom_Exception

Are you bootstrapping your own custom response object? I ran into something like this and it turns out I needed to use the CLI response in order for unit testing to work correctly. If you're not bootstrapping the response, then Zend_Test should use the right one automatically.

--
Hector


On Wed, May 5, 2010 at 5:24 AM, SteveG-UK <ste.goddard@gmail.com> wrote:

Hi,

I'm getting a Zend_Dom_Exception when trying to unit test a controller-:

There was 1 error:

1) UnitControllerTest::testAddAction
Zend_Dom_Exception: Cannot query; no document registered

public function testAddAction(){
      $this->dispatch('/unit/add');
       $this->assertResponseCode('200');
       $this->assertQuery('form-test');
}

This only happens when $this->assertQuery('form-test');  is in the above
method.

The controller & action work fine in a browser !

Googled for days and cant find the answer.

Thanks in advance.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/PHPUnit-testing-generating-Zend-Dom-Exception-tp2130849p2130849.html
Sent from the Zend MVC mailing list archive at Nabble.com.


没有评论: