12

We just started working on a Magento project where there is a need for some complicated changes to the Magento SOAP API. Since we never properly worked with unit tests, this looked like a good case to use unit testing for once. Since these API calls need to be really good tested and very stable.

Now, I heard a lot of great things about the EcomDev_PHPUnit extension so after reading a lot of material about it, I installed it and tried to get it working.

But now we run into trouble when performing a SOAP call during those tests. It looks like when you perform a SOAP call using the test base_url, defined in the local.xml.phpunit file, Magento redirects us to the normal base_url. So I'm guessing when the SOAP call comes in, it is probably using the normal database and not the test database. Which makes sense, since this is a new process which bootstraps Magento again through the webserver, so Magento isn't aware it should be running in a test context.

Has anyone got experience with testing SOAP calls using the EcomDev_PHPUnit extension? Or does anyone have an idea how to make this work? It would be very handy for us, since we can use all the great features of this extension, especially the fixtures and the test database.

Thanks!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.