Tell me more ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

Here is described old version: http://www.ecomdev.org/2011/02/01/phpunit-and-magento-yes-you-can.html

And they wrote that I need call phpunit UnitTests.php

But I have magento v.1.7. I downloaded newest version: https://github.com/IvanChepurnyi/EcomDev_PHPUnit

But there are not any files like UnitTests.php

How I should run unit test then?

share|improve this question

2 Answers

up vote 5 down vote accepted

I think this is the neewst available documentation: http://www.ecomdev.org/wp-content/uploads/2011/05/EcomDev_PHPUnit-0.2.0-Manual.pdf

In the current version EcomDev_PHPUnit ships with a phpunit.xml.dist. Rename this one to phpunit.xml, make modifications if necessary and then simply execute phpunit without parameters.

share|improve this answer
 
For some reason I got an error then: Fatal error: Uncaught exception 'Exception' with message 'Warning: include(PHP/Invoker.php)' –  Anthony May 14 at 8:07
 
Looks like you hit a problem with unit testing Magento. Can you install the PHPunit php-invoker package? Maybe this is related: github.com/sebastianbergmann/phpunit/pull/754 –  Alex May 14 at 8:14
 
thanks for your help! Phpunit works, I just installed another packages. But phpunit still has an error: codepad.org/k7lmQucJ. (I didn't create any test for a while) What is the problem colud be here? –  Anthony May 14 at 14:25
 
Okay - that is one of the tests which are integrated in EcomDev itself that fails. But having a look at the line github.com/EcomDev/EcomDev_PHPUnit/blob/master/app/code/… it seems that EcomDev can not load the matching expection file from github.com/EcomDev/EcomDev_PHPUnit/blob/master/app/code/…. (Expected is empty, but actual has data) –  Alex May 14 at 16:30

there is no need. just run phpunit it wil find the phpunit.xml.dist(as fallback) automatically and use the configuration in this file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.