Closed ExtensionsStore closed 9 years ago
How did you solve this issue @ExtensionsStore?
php -ddisplay_errors=1 bin/phpunit
?
Thanks @IvanChepurnyi. I enabled error displaying on all levels, but it still silently fails. For me, it silently fails on:
$orderCollectionMock = $this->getResourceModelMock('sales/order_collection', array('getSize', 'getFirstItem'));
But it also fails on something simple like this:
$orderMock = $this->getModelMock('sales/order', array('getIncrementId'));
In PHPStorm you can run unit tests with Debugger. Put a breakpoint before mock and then do Step IN to find where it fails.
I did. It basically failed on EcomDev_PHPUnit_Mock_Proxy::__construct
. I tried various versions of phpunit. Latest 3.x, latest 5.x, latest 6.x did not work. But latest phpunit 4.x (4.8.36) indeed seems to work!
So EcomDev_PHPUnit
only works with phpunit 4.x?
I'm trying to get a mock of my observer, but nothing happens:
phpunit just silently exits. Please help.