## Convenience Function for Mocking Methods ### Acceptance Criteria 1. `TestCase::mockMethod` exists, and takes the following parameters: - Name of mock object (Must be a key in `$this->mocks`) - Name of method (Must be a method of that mock object) - Callback to provide to `returnCallback` This will transform: ``` PHP $this->mocks['roleService']->expects($this->any()) ->method('addRoleForUser') ->will($this->returnCallback(function ($user, $role) { // Code here })); ``` Into this: ``` PHP $this->mockMethod('roleService', 'addRoleForUser', function ($user, $role) { // Code here }); ``` ### Tasks - Add method to `TestCase` ### Additional Notes - None
Convenience Function for Mocking Methods
Acceptance Criteria
TestCase::mockMethodexists, and takes the following parameters:$this->mocks)returnCallbackThis will transform:
Into this:
Tasks
TestCaseAdditional Notes