I use Symfony 3.4. I have functional tests which extend from Liip\FunctionalTestBundle\Test\WebTestCase
and in some function I want mock some service, I create mockobject for service but in action I still have original service, how to mock service
in my function
$mock = $this->getMockBuilder(AdditionalFunction::class)
->disableOriginalConstructor()->getMock();
$this->getContainer()->set('app.additional_function', $mock);
$this->getClient()->request(
Request::METHOD_GET,
$uri
);
and in my action $uri
public function sendAction(OutboundInvoice $outboundInvoice)
{
$test = $this->get('app.additional_function');
in variable $test
I had original class AppBundle\Helper\AdditionalFunction
How to mock service ?