I have a Symfony class I am trying to mock using Prophecy. However, when I reveal the class it executes the constructor. Below is example code:
$mock = $this->prophesize('Symfony\Component\HttpFoundation\File\UploadedFile');
$mock->reveal();
which returns the exception
Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
which doesn't make sense to me as Prophecy is supposed to automatically disable the constructor?
I had the same problem and had to mock without prophecy:
$uploadedFile = $this->getMockBuilder(UploadedFile::class)->disableOriginalConstructor()->getMock();
Probably related https://github.com/phpspec/prophecy/issues/58