2 namespace Friendica\Test\src\Util;
4 use Friendica\Test\MockedTest;
5 use Friendica\Util\BasePath;
7 class BasePathTest extends MockedTest
10 * Test the basepath determination
12 public function testDetermineBasePath()
14 $serverArr = ['DOCUMENT_ROOT' => '/invalid', 'PWD' => '/invalid2'];
15 $this->assertEquals('/valid', BasePath::create('/valid', $serverArr));
19 * Test the basepath determination with DOCUMENT_ROOT and PWD
21 public function testDetermineBasePathWithServer()
23 $serverArr = ['DOCUMENT_ROOT' => '/valid'];
24 $this->assertEquals('/valid', BasePath::create('', $serverArr));
26 $serverArr = ['PWD' => '/valid_too'];
27 $this->assertEquals('/valid_too', BasePath::create('', $serverArr));