Use php temp path by default; "$this" should be "self"; ignore dev files

This commit is contained in:
Maxim Rubis
2018-10-31 09:35:33 -04:00
parent c0cb5fbca0
commit 64cdbe0609
2 changed files with 6 additions and 2 deletions

2
.gitignore vendored
View File

@@ -33,3 +33,5 @@ cache.properties
composer.phar composer.phar
phpunit.xml phpunit.xml
.php_cs.cache .php_cs.cache
web.config
.vscode/

View File

@@ -11,7 +11,9 @@ class InterfaceTest extends WebTestCase
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
if (getenv('TMP')) { if(sys_get_temp_dir()) {
self::$tmpdir = sys_get_temp_dir();
} elseif (getenv('TMP')) {
self::$tmpdir = getenv('TMP'); self::$tmpdir = getenv('TMP');
} elseif (getenv('TMPDIR')) { } elseif (getenv('TMPDIR')) {
self::$tmpdir = getenv('TMPDIR'); self::$tmpdir = getenv('TMPDIR');
@@ -25,7 +27,7 @@ class InterfaceTest extends WebTestCase
$fs->mkdir(self::$tmpdir); $fs->mkdir(self::$tmpdir);
if (!is_writable(self::$tmpdir)) { if (!is_writable(self::$tmpdir)) {
$this->markTestSkipped('There are no write permissions in order to create test repositories.'); self::markTestSkipped('There are no write permissions in order to create test repositories.');
} }
$options['path'] = getenv('GIT_CLIENT') ?: '/usr/bin/git'; $options['path'] = getenv('GIT_CLIENT') ?: '/usr/bin/git';