Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
edit.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Feb 2014 at 10:49 UTC
Updated:
29 Jul 2014 at 23:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirComment #4
berdirFixing tests.
Comment #5
tim.plunkettWhy not just use the service here?
Otherwise, RTBC.
Comment #6
berdirYeah, this might have made sense when there were no dependencies, but it's pointless now. Kept it for the MetadataGenerator, as that one needs a mocked access checker.
Comment #7
tim.plunkettGreat, thanks!
Comment #8
wim leersRTBC +1, thanks!
Comment #9
berdirRe-roll after #2053153: Allow contrib modules to provide plugins on behalf of optional modules
Comment #11
berdirAh, the new feature now gets in the way and removes that definition because it comes from a module that the injected instance of the module handler doesn't know about. Either way, updating the objects helps. This works right now in HEAD because only the default plugin manager has that logic built in.
The whole class is kind of a strange mix of a DUBT test and a unit test by mixing the use of manually created objects and objects from the container and custom mocks, and assigning them to properties, so that they are not updated when module list changes.
I think it should either always call $this->container->get('plugin.manager.edit.editor') etc. directly, probably use a way to grant actual permissions to the current user, so that the normal access checker works, or be converted to a real unit test where everything except the class being tested is mocked. That definitely wasn't possible when it was originally written, but I think we're much closer to that being possible now :)
Comment #12
wim leersAgreed :) But for now, this is RTBC, converting to a PHPUnit test can be a follow-up.
Comment #13
alexpottCommitted 8e47a4e and pushed to 8.x. Thanks!