-
Notifications
You must be signed in to change notification settings - Fork 28
API - getEnabledFeatures #81
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
API - getEnabledFeatures #81
Conversation
|
Can one of the admins verify this patch? |
mikeproeng37
left a comment
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.
Mostly looks good. Just have a few comments on it.
src/Optimizely/Optimizely.php
Outdated
| */ | ||
| public function getEnabledFeatures($userId, $attributes = null) | ||
| { | ||
| $enabled_feature_keys = []; |
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.
Please change all variables to camel case: $enabledFeatureKeys
| $this->assertEmpty($optimizelyMock->getEnabledFeatures("user_id", [])); | ||
| } | ||
|
|
||
| public function testGetEnabledFeaturesGivenFeaturesAreEnabledForUser() |
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.
I'd suggest adding one more test case where the user also has attributes
|
E2E tests pass. Going to merge this in. |
mikeproeng37
left a comment
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.
lgtm
| foreach ($featureFlags as $feature){ | ||
| $featureKey = $feature->getKey(); | ||
| if ($this->isFeatureEnabled($featureKey, $userId, $attributes) === true) { | ||
| $enabledFeatureKeys[] = $featureKey; |
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.
Wow. Wasn't aware of this syntax. Neat. Just make sure travis passes across all PHP versions.
|
E2e tests are once again passing. Merging this PR in. |
No description provided.