I am trying to mock this method:
$transformer = $this->transformerFactory->createProductTransformer($product, function (ProductInterface $product) use ($discount) {
$product->setDiscount($discount);
});
It accepts callback parameter as a second argument and I don't know how to mock it.
I am using Mockery so that would look like that:
$this->transformerFactoryMock
->shouldReceive('createProductTransformer')
->with(???) // here!
If I pass the same callback to the with() method, the instances does not match. I don't mind using PHPUnit mocking if Mockery doesn't support that.