mirror of
https://github.com/friendica/friendica
synced 2025-04-26 13:50:11 +00:00
Improve BasePath tests
This commit is contained in:
parent
0bd8118673
commit
ae0cab36dc
1 changed files with 15 additions and 12 deletions
|
@ -16,46 +16,49 @@ class BasePathTest extends TestCase
|
||||||
{
|
{
|
||||||
public static function getDataPaths(): array
|
public static function getDataPaths(): array
|
||||||
{
|
{
|
||||||
|
$basePath = dirname(__DIR__, 3);
|
||||||
|
$configPath = $basePath . DIRECTORY_SEPARATOR . 'config';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'fullPath' => [
|
'fullPath' => [
|
||||||
'server' => [],
|
'server' => [],
|
||||||
'baseDir' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'baseDir' => $configPath,
|
||||||
'expected' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'expected' => $configPath,
|
||||||
],
|
],
|
||||||
'relative' => [
|
'relative' => [
|
||||||
'server' => [],
|
'server' => [],
|
||||||
'baseDir' => 'config',
|
'baseDir' => 'config',
|
||||||
'expected' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'expected' => $configPath,
|
||||||
],
|
],
|
||||||
'document_root' => [
|
'document_root' => [
|
||||||
'server' => [
|
'server' => [
|
||||||
'DOCUMENT_ROOT' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'DOCUMENT_ROOT' => $configPath,
|
||||||
],
|
],
|
||||||
'baseDir' => '/noooop',
|
'baseDir' => '/noooop',
|
||||||
'expected' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'expected' => $configPath,
|
||||||
],
|
],
|
||||||
'pwd' => [
|
'pwd' => [
|
||||||
'server' => [
|
'server' => [
|
||||||
'PWD' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'PWD' => $configPath,
|
||||||
],
|
],
|
||||||
'baseDir' => '/noooop',
|
'baseDir' => '/noooop',
|
||||||
'expected' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'expected' => $configPath,
|
||||||
],
|
],
|
||||||
'no_overwrite' => [
|
'no_overwrite' => [
|
||||||
'server' => [
|
'server' => [
|
||||||
'DOCUMENT_ROOT' => dirname(__DIR__, 3),
|
'DOCUMENT_ROOT' => $basePath,
|
||||||
'PWD' => dirname(__DIR__, 3),
|
'PWD' => $basePath,
|
||||||
],
|
],
|
||||||
'baseDir' => 'config',
|
'baseDir' => 'config',
|
||||||
'expected' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'expected' => $configPath,
|
||||||
],
|
],
|
||||||
'no_overwrite_if_invalid' => [
|
'no_overwrite_if_invalid' => [
|
||||||
'server' => [
|
'server' => [
|
||||||
'DOCUMENT_ROOT' => '/nopopop',
|
'DOCUMENT_ROOT' => '/nopopop',
|
||||||
'PWD' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'PWD' => $configPath,
|
||||||
],
|
],
|
||||||
'baseDir' => '/noatgawe22fafa',
|
'baseDir' => '/noatgawe22fafa',
|
||||||
'expected' => dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'config',
|
'expected' => $configPath,
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue