示例#1
0
 /**
  * Sets up test case - initializes directory in %TEMP%
  *
  * @return void
  */
 public function setUp()
 {
     $this->temp = $this->normalize(realpath(Environment::tempDir())) . md5(uniqid()) . '.xp' . DIRECTORY_SEPARATOR;
     if (is_dir($this->temp) && !rmdir($this->temp)) {
         throw new PrerequisitesNotMetError('Fixture directory exists, but cannot remove', null, $this->temp);
     }
 }
示例#2
0
 /**
  * Constructor
  *
  * @param   string $prefix default "tmp"
  */
 public function __construct($prefix = 'tmp')
 {
     parent::__construct(tempnam(Environment::tempDir(), $prefix . uniqid((double) microtime())));
 }
 public function xdg_config_dir_default()
 {
     with(new EnvironmentSet(['HOME' => 'dir', 'XDG_RUNTIME_DIR' => '/run/user/1000']), function () {
         $this->assertEquals('dir' . DIRECTORY_SEPARATOR . '.config' . DIRECTORY_SEPARATOR, Environment::configDir());
     });
 }