Showing results for 
Search instead for 
Did you mean: 

Fatal error in test automation mock class

Fatal error in test automation mock class

I've set up a sandbox (PHP7, linux) with a clean installation of Magento 2.1. When I run dev:tests:run, phpunit throws a fatal error about 8000 operations into the unit-testing process:


PHP Fatal error: Uncaught Error: Call to undefined method Mock_SoapClient_a58256b2::__setSoapHeaders() in /home/experius/domains/
Stack trace:
#0 /home/experius/domains/ Magento\Payment\Gateway\Http\Client\Soap->placeRequest(Object(Mock_TransferInterface_7258632b))
#1 [internal function]: Magento\Payment\Test\Unit\Gateway\Http\Client\SoapTest->testPlaceRequest()
#2 /home/experius/domains/ ReflectionMethod->invokeArgs(Object(Magento\Payment\Test\Unit\Gateway\Http\Client\SoapTest), Array)
#3 /home/experius/domains/ PHPUnit_Framework_TestCase->runTest()
#4 /home/experius/domains/ in /home/experius/domains/ on line 70


It then skips the remaining 9000 lines of unit testing before going into static tests.


It seems like one of the mock classes generated for automated testing isn't programmed to have all the proper methods. 

Am I doing something wrong, or is this a bug in phpunit or Magento 2? A couple of other tests fail, too, despite being a clean installation.