コード例 #1
0
ファイル: Facade.php プロジェクト: mean-cj/config-writer
 /**
  * Register the service provider.
  *
  * @return void
  */
 public static function write($config, array $newValues = [], $validate = true, $path = 'config')
 {
     $config = new Repository($config, $path);
     foreach ($newValues as $key => $value) {
         $config->set($key, $value);
     }
     $config->save(null, null, $validate);
 }
コード例 #2
0
 /**
  * @dataProvider readmeExampleTestProvider
  */
 public function testReadmeExample($repository, $setProperty, $setValue, $checkProperty, $checkValue, $expectIfCheckMatches, $expectIfCheckFails)
 {
     $config = new Repository($repository);
     $config->set($setProperty, $setValue);
     $expectThis = $expectIfCheckFails;
     if ($config->get($checkProperty, $checkValue)) {
         $expectThis = $expectIfCheckMatches;
         $config->set($setProperty, $expectIfCheckMatches);
     }
     $config->save();
     $config = new Repository($repository);
     $this->expectSame($config->get($setProperty), $expectThis);
 }