I've read lots of documentation about testing controllers using $this->call($destination, $parameters, 'GET');
but this seems to rely on the route being set up too, and knowing the right $destination
to use.
Generally this is OK, but accessing a controller from a route doesn't seem right for unit testing. I want to unit test the controller, not the route. Is there a standard way to unit test controllers, without dealing with routes?
Is simply manually instantiating the controller and calling the method enough? E.g.
$controller = new MyController;
$response = $controller->someMethod($param);
$this->assertSomething($response);
Perhaps controllers shouldn't be unit tested (and only have acceptance tests) and my request is a sign that my controllers are too heavy.