Skip to content
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

Merged
merged 2 commits into from
Jun 10, 2016
Merged

Convert OgAccess into a service #226

merged 2 commits into from
Jun 10, 2016

Conversation

pfrenssen
Copy link
Collaborator

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.

@@ -47,6 +48,16 @@ class OgAccessTestBase extends UnitTestCase {
*/
protected $groupManager;

/**
* The OgAccess class, this is the system under test.
Copy link
Owner

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.?

Copy link
Collaborator Author

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.

Copy link
Owner

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.

@pfrenssen
Copy link
Collaborator Author

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.
@amitaibu amitaibu merged commit c4595e3 into 8.x-1.x Jun 10, 2016
@amitaibu amitaibu deleted the og-access-service branch June 10, 2016 17:20
@amitaibu
Copy link
Owner

Thanks.

amitaibu added a commit that referenced this pull request Dec 14, 2016
OgMembership static cache are not cleared on membership save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants