2

I have a custom module with form. I want to post values from unit test file to my custom module controller.

I tried $this->request = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class) ->disableOriginalConstructor() ->setMethods(['getPost']) ->getMockForAbstractClass();

    $this->request->expects($this->any())->method('getPost')->will($this->returnSelf());

It passed POST check but how to pass variable to controller.

thanks in advance

  • Have you removed generated folder, cache:clear ? – Ajwad Taqvi Nov 28 '18 at 12:56
  • Yes already done. – Sharif Kareem Nov 29 '18 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.