{
$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());
*/
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 [
[
{
$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();
$this->assertFalse($config->requireSemicolons());
$this->assertTrue($config->useUnicode());
- chdir($oldPwd);
+ \chdir($oldPwd);
}
/**
private function joinPath()
{
- return implode(DIRECTORY_SEPARATOR, func_get_args());
+ return \implode(DIRECTORY_SEPARATOR, \func_get_args());
}
public function testConfigIncludes()