-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert OgAccess into a service #226
Conversation
@@ -47,6 +48,16 @@ class OgAccessTestBase extends UnitTestCase { | |||
*/ | |||
protected $groupManager; | |||
|
|||
/** | |||
* The OgAccess class, this is the system under test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean by this is the system under test.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that is the formal name in unit testing for the class that is being tested, it's called the "SUT" or System Under Test.
It's not yet common in the Drupalverse, I'll make it clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries, if it's PHP standard we can use it.
Hopefully this is a bit clearer. The cacheability stuff is one of the hardest parts in Drupal 8 for me. |
…m the OG settings config object during access checks.
Thanks. |
OgMembership static cache are not cleared on membership save
Currently
OgAccess
consists of a collection of static methods. When we initially started the D8 port it made sense to use static methods so we could iterate rapidly, but currently this is starting to impede progress.This PR converts
OgAccess
into a proper service that uses the dependency injection container for its dependencies, so it can be properly mocked in unit tests.