ALPHA 3.0.2a

This commit is contained in:
TheGamecraft
2018-09-10 08:51:18 -04:00
parent 7fe13ae0a7
commit 0e0ef86b71
1404 changed files with 10604 additions and 33714 deletions

View File

@@ -30,10 +30,10 @@ class ConfigurationTest extends \PHPUnit\Framework\TestCase
{
$config = $this->getConfig();
$this->assertSame(function_exists('readline'), $config->hasReadline());
$this->assertSame(function_exists('readline'), $config->useReadline());
$this->assertSame(function_exists('pcntl_signal'), $config->hasPcntl());
$this->assertSame(function_exists('pcntl_signal'), $config->usePcntl());
$this->assertSame(\function_exists('readline'), $config->hasReadline());
$this->assertSame(\function_exists('readline'), $config->useReadline());
$this->assertSame(\function_exists('pcntl_signal'), $config->hasPcntl());
$this->assertSame(\function_exists('pcntl_signal'), $config->usePcntl());
$this->assertFalse($config->requireSemicolons());
$this->assertSame(Configuration::COLOR_MODE_AUTO, $config->colorMode());
$this->assertNull($config->getStartupMessage());
@@ -57,20 +57,20 @@ class ConfigurationTest extends \PHPUnit\Framework\TestCase
*/
public function testFilesAndDirectories($home, $configFile, $historyFile, $manualDbFile)
{
$oldHome = getenv('HOME');
putenv("HOME=$home");
$oldHome = \getenv('HOME');
\putenv("HOME=$home");
$config = new Configuration();
$this->assertSame(realpath($configFile), realpath($config->getConfigFile()));
$this->assertSame(realpath($historyFile), realpath($config->getHistoryFile()));
$this->assertSame(realpath($manualDbFile), realpath($config->getManualDbFile()));
$this->assertSame(\realpath($configFile), \realpath($config->getConfigFile()));
$this->assertSame(\realpath($historyFile), \realpath($config->getHistoryFile()));
$this->assertSame(\realpath($manualDbFile), \realpath($config->getManualDbFile()));
putenv("HOME=$oldHome");
\putenv("HOME=$oldHome");
}
public function directories()
{
$base = realpath(__DIR__ . '/fixtures');
$base = \realpath(__DIR__ . '/fixtures');
return [
[
@@ -125,21 +125,21 @@ class ConfigurationTest extends \PHPUnit\Framework\TestCase
{
$config = $this->getConfig(__DIR__ . '/fixtures/config.php');
$runtimeDir = $this->joinPath(realpath(sys_get_temp_dir()), 'psysh_test', 'withconfig', 'temp');
$runtimeDir = $this->joinPath(\realpath(\sys_get_temp_dir()), 'psysh_test', 'withconfig', 'temp');
$this->assertStringStartsWith($runtimeDir, realpath($config->getTempFile('foo', 123)));
$this->assertStringStartsWith($runtimeDir, realpath(dirname($config->getPipe('pipe', 123))));
$this->assertStringStartsWith($runtimeDir, realpath($config->getRuntimeDir()));
$this->assertStringStartsWith($runtimeDir, \realpath($config->getTempFile('foo', 123)));
$this->assertStringStartsWith($runtimeDir, \realpath(\dirname($config->getPipe('pipe', 123))));
$this->assertStringStartsWith($runtimeDir, \realpath($config->getRuntimeDir()));
$this->assertSame(function_exists('readline'), $config->useReadline());
$this->assertSame(\function_exists('readline'), $config->useReadline());
$this->assertFalse($config->usePcntl());
$this->assertSame(E_ALL & ~E_NOTICE, $config->errorLoggingLevel());
}
public function testLoadLocalConfigFile()
{
$oldPwd = getcwd();
chdir(realpath(__DIR__ . '/fixtures/project/'));
$oldPwd = \getcwd();
\chdir(\realpath(__DIR__ . '/fixtures/project/'));
$config = new Configuration();
@@ -153,7 +153,7 @@ class ConfigurationTest extends \PHPUnit\Framework\TestCase
$this->assertFalse($config->requireSemicolons());
$this->assertTrue($config->useUnicode());
chdir($oldPwd);
\chdir($oldPwd);
}
/**
@@ -166,7 +166,7 @@ class ConfigurationTest extends \PHPUnit\Framework\TestCase
private function joinPath()
{
return implode(DIRECTORY_SEPARATOR, func_get_args());
return \implode(DIRECTORY_SEPARATOR, \func_get_args());
}
public function testConfigIncludes()