Author: Richard Fullmer (richard.fullmer@opensoftdev.com)
コード例 #1
0
ファイル: FeatureTest.php プロジェクト: opensoft/rollout
 public function testParseNewSettingsFormat()
 {
     $feature = new Feature('chat', '100|4,12|fivesonly|FF_facebookIntegration=1');
     $this->assertEquals(100, $feature->getPercentage());
     $this->assertEquals([4, 12], $feature->getUsers());
     $this->assertEquals(['fivesonly'], $feature->getGroups());
     $this->assertEquals('FF_facebookIntegration=1', $feature->getRequestParam());
 }
コード例 #2
0
ファイル: Rollout.php プロジェクト: opensoft/rollout
 /**
  * @param Feature $feature
  */
 private function save(Feature $feature)
 {
     $name = $feature->getName();
     $this->storage->set($this->key($name), $feature->serialize());
     $features = $this->features();
     if (!in_array($name, $features)) {
         $features[] = $name;
     }
     $this->storage->set($this->featuresKey(), implode(',', $features));
 }