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();


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

thanks in advance

  • Have you removed generated folder, cache:clear ?
    – Ajwad Syed
    Nov 28, 2018 at 12:56
  • Yes already done. Nov 29, 2018 at 4:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.