ouzo icon indicating copy to clipboard operation
ouzo copied to clipboard

Docs for controller tests with injector

Open woru opened this issue 9 years ago • 1 comments

woru avatar Jan 25 '16 15:01 woru

Can we change injector $config in ControllerTestCase to a protected field?

//given
$userService = Mock::create('UserService');
$this->injectorConfig->bind('UserService')->toInstance($userService);

//when
$this->post('/users', [...]);

//then
Mock::verify($userService)->save(...);

woru avatar Jan 25 '16 15:01 woru