public function testLoadConfigFile() { $config = new Configuration(array('configFile' => __DIR__ . '/../../fixtures/rc.php')); $tempDir = $this->joinPath(realpath(sys_get_temp_dir()), 'psysh_test', 'withconfig', 'temp'); $this->assertStringStartsWith($tempDir, realpath($config->getTempFile('foo', 123))); $this->assertStringStartsWith($tempDir, realpath(dirname($config->getPipe('pipe', 123)))); $this->assertStringStartsWith($tempDir, realpath($config->getTempDir())); $this->assertEquals(function_exists('readline'), $config->useReadline()); $this->assertFalse($config->usePcntl()); }
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()); }