/**
  * @param string $path [Optional] Temporary path from which the Configuration framework
  * should load files. This is useful when writing temp files to disk for funtional tests
  */
 public static function reset($path = null)
 {
     if (!self::$pathField) {
         self::$pathField = Reflection_Helper::get_property('Bart\\Configuration\\Configuration', 'path');
         self::$configCacheField = Reflection_Helper::get_property('Bart\\Configuration\\Configuration', 'configCache');
     }
     self::$pathField->setValue(null, $path);
     self::$configCacheField->setValue(null, []);
 }
示例#2
0
文件: GitTest.php 项目: martinsv/bart
 public function test_chain_commands()
 {
     $this->registerMockShell();
     $git = new Git('.git');
     $hello_world_commands = array('hello world', 'and then there was more');
     $method = Util\Reflection_Helper::get_method('Bart\\Git', 'chain_commands');
     $hello = $method->invokeArgs($git, array($hello_world_commands));
     $this->assertEquals($hello, 'git --git-dir=.git hello world && git --git-dir=.git and then there was more', 'Chain commands produced wrong cmd');
 }
示例#3
0
 private static function getSafeCommandFrom(Command $c)
 {
     $field = \Bart\Util\Reflection_Helper::get_property('Bart\\Shell\\Command', 'safeCommandStr');
     return $field->getValue($c);
 }
示例#4
0
 /**
  * @param array $configsArray The new internal configurations
  */
 public function configureForTesting(array $configsArray)
 {
     $this->configurations = $configsArray;
     // Some rigmarole for any methods using updateRuntimeConfiguration
     $pathField = Reflection_Helper::get_property('Bart\\Configuration\\Configuration', 'filePath');
     $pathField->setValue($this, '');
     TestConfigurationsHelper::setConfigCache($configsArray);
 }