Exemplo n.º 1
0
 public function testLoadConfigFile()
 {
     $config = new Configuration(array('configFile' => __DIR__ . '/../../fixtures/config.php'));
     $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->assertEquals(function_exists('readline'), $config->useReadline());
     $this->assertFalse($config->usePcntl());
     $this->assertEquals(E_ALL & ~E_NOTICE, $config->errorLoggingLevel());
 }
Exemplo n.º 2
0
 public function testLoadConfigFile()
 {
     $config = new Configuration(array('configFile' => __DIR__ . '/../../fixtures/config.php'));
     $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 will be deprecated, but we want to actually test the value.
     $was = error_reporting(error_reporting() & ~E_USER_DEPRECATED);
     $this->assertStringStartsWith($runtimeDir, realpath($config->getTempDir()));
     error_reporting($was);
     $this->assertStringStartsWith($runtimeDir, realpath($config->getRuntimeDir()));
     $this->assertEquals(function_exists('readline'), $config->useReadline());
     $this->assertFalse($config->usePcntl());
 }