Пример #1
0
 /**
  * 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);
 }