Skip to content

Conversation

@oakbani
Copy link
Contributor

@oakbani oakbani commented Dec 13, 2017

No description provided.

@optibot
Copy link

optibot commented Dec 13, 2017

Can one of the admins verify this patch?

@coveralls
Copy link

coveralls commented Dec 13, 2017

Coverage Status

Coverage increased (+0.03%) to 96.875% when pulling d8075c7 on msohailhussain:get_enabled_features into c7b1bd1 on optimizely:master.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a 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.

*/
public function getEnabledFeatures($userId, $attributes = null)
{
$enabled_feature_keys = [];
Copy link
Contributor

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()
Copy link
Contributor

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

@coveralls
Copy link

coveralls commented Dec 14, 2017

Coverage Status

Coverage increased (+0.03%) to 96.875% when pulling b103fa1 on msohailhussain:get_enabled_features into c7b1bd1 on optimizely:master.

@mikeproeng37
Copy link
Contributor

E2E tests pass. Going to merge this in.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a 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;
Copy link
Contributor

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.

@coveralls
Copy link

coveralls commented Dec 14, 2017

Coverage Status

Coverage increased (+0.03%) to 96.875% when pulling 8da8260 on msohailhussain:get_enabled_features into b33d751 on optimizely:master.

@mikeproeng37
Copy link
Contributor

E2e tests are once again passing. Merging this PR in.

@mikeproeng37 mikeproeng37 merged commit deadcde into optimizely:master Dec 14, 2017
@oakbani oakbani deleted the get_enabled_features branch December 15, 2017 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants