Opensoft\Rollout\Rollout::deactivateGroup PHP Метод

deactivateGroup() публичный Метод

public deactivateGroup ( string $feature, string $group )
$feature string
$group string
    public function deactivateGroup($feature, $group)
    {
        $feature = $this->get($feature);
        if ($feature) {
            $feature->removeGroup($group);
            $this->save($feature);
        }
    }

Usage Example

Пример #1
0
 public function testDeactivatingAGroup()
 {
     $this->rollout->defineGroup('fivesonly', function (RolloutUserInterface $user) {
         return $user->getRolloutIdentifier() == 5;
     });
     $this->rollout->activateGroup('chat', 'all');
     $this->rollout->activateGroup('chat', 'some');
     $this->rollout->activateGroup('chat', 'fivesonly');
     $this->rollout->deactivateGroup('chat', 'all');
     $this->rollout->deactivateGroup('chat', 'some');
     // deactivates the rules for that group
     $this->assertFalse($this->rollout->isActive('chat', new RolloutUser(10)));
     // leaves the other groups active
     $this->assertContains('fivesonly', $this->rollout->get('chat')->getGroups());
     $this->assertCount(1, $this->rollout->get('chat')->getGroups());
 }