The LocalTaskManagerTest is only working because of:
$this->manager = $this
->getMockBuilder('Drupal\Core\Menu\LocalTaskManager')
->disableOriginalConstructor()
->setMethods(array('enforcePluginInterface'))
->getMock();
Which means the only method we are mocking is the non existing enforcePluginInterface method.
Let's just create a proper LocalTaskManager to test.
| Comment | File | Size | Author |
|---|---|---|---|
| d8.local-task-manager-test.patch | 5.29 KB | alexpott |
Comments
Comment #1
dawehnerI don't really get why its typehinted in the main code. We don't use getControllerFromDefinition in the LocalTaskManager code
Does that mean that we should NOT use the getMockBuilder for the tested class at all, but otherwise, if needed use the TestFoo approach?
+1 for getting rid of as many as possible ugly setAccessible calls.
Comment #2
dawehner.
Comment #3
catchCommitted/pushed to 8.0.x, thanks!