예제 #1
0
 /**
  * @Issue("Create a Symonfy bundle for better integration incl. Twig extension")
  */
 public static function symfony2($varName, $varValue = null)
 {
     $input = realpath(__DIR__ . '/../../../../app/config/feature-toggle.yml');
     $loader = new ConfigLoaderYaml(new YamlParser(), $input);
     $toggle = new ToggleConfig($loader, $varName, $varValue);
     return $toggle->on();
 }
 public function testResultForVariableWithStringValue()
 {
     $config = array('varName1' => 'varValue1');
     $loader = $this->getMockBuilder('\\KrystalCode\\FeatureToggle\\ConfigLoaderPhp')->disableOriginalConstructor()->getMock();
     $loader->expects($this->once())->method('load')->willReturn($config);
     $toggle = new ToggleConfig($loader, 'varName1', 'varValue1');
     $this->assertTrue($toggle->on());
 }