2

I am implementing a controller test, where I add some product to the cart and want to check its price:

It looks like I can call dispatch only once?

$this->dispatch('custom/add/?foo=bar');

$this->assertRedirect($this->stringContains('checkout/cart'));

$this->setUp();
$this->dispatch('checkout/cart');
$this->assertRegExp('#<span class="price">.*999\.00</span>#', $this->getResponse()->getBody());

I already tried to call setUp to clear the state, but still the first action seems to be called on the second dispatch call.

EDIT:

\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize();

is also not helping

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.