]> git.mxchange.org Git - friendica.git/blob - tests/src/Util/BasePathTest.php
Adding basepath, urlpath, hostname and ssl_policy to installation
[friendica.git] / tests / src / Util / BasePathTest.php
1 <?php
2 namespace Friendica\Test\src\Util;
3
4 use Friendica\Test\MockedTest;
5 use Friendica\Util\BasePath;
6
7 class BasePathTest extends MockedTest
8 {
9         /**
10          * Test the basepath determination
11          */
12         public function testDetermineBasePath()
13         {
14                 $serverArr = ['DOCUMENT_ROOT' => '/invalid', 'PWD' => '/invalid2'];
15                 $this->assertEquals('/valid', BasePath::create('/valid', $serverArr));
16         }
17
18         /**
19          * Test the basepath determination with DOCUMENT_ROOT and PWD
20          */
21         public function testDetermineBasePathWithServer()
22         {
23                 $serverArr = ['DOCUMENT_ROOT' => '/valid'];
24                 $this->assertEquals('/valid', BasePath::create('', $serverArr));
25
26                 $serverArr = ['PWD' => '/valid_too'];
27                 $this->assertEquals('/valid_too', BasePath::create('', $serverArr));
28         }
29 }