Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>thanks for your help. I found that <code>$this-&gt;resetRequest();</code> and <code>$this-&gt;resetResponse();</code> threw errors, but I checked the <a href="http://framework.zend.com/apidoc/core/Zend_Test/PHPUnit/Zend_Test_PHPUnit_ControllerTestCase.html#reset" rel="nofollow noreferrer">method summary for Zend_Test_PHPUnit_ControllerTestCase</a> and found <code>$this-&gt;reset();</code> The linked page does list the methods you mention, but they're listed differently.</p> <p><code>$this-reset();</code> alone also threw an error (No default module defined for this application), but I found that if I called <code>$this-&gt;bootstrap();</code> afterwards the tests passed. Is this a valid solution? For clarify, my test code is now:</p> <pre><code>public function testEditProduct() { $request = $this-&gt;getRequest(); $request-&gt;setMethod('POST'); $request-&gt;setPost(array( 'id'=&gt;'1', 'title'=&gt;'Test Product 1a' )); $this-&gt;dispatch('/product/edit/id/1'); $this-&gt;assertRedirectTo('/'); $this-&gt;reset(); $this-&gt;bootstrap(); $this-&gt;dispatch('/'); $this-&gt;assertQueryContentContains('a', 'Test Product 1a'); } public function testAddProduct() { $request = $this-&gt;getRequest(); $request-&gt;setMethod('POST'); $request-&gt;setPost(array( 'title'=&gt;'Test Product 3' )); $this-&gt;dispatch('/product/add/'); $this-&gt;assertRedirectTo('/'); $this-&gt;reset(); $this-&gt;bootstrap(); $this-&gt;dispatch('/'); $this-&gt;assertQueryContentContains('a', 'Test Product 3'); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload