Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
737 B

<?php
namespace Friendica\Test\src\Util;
use Friendica\Test\MockedTest;
use Friendica\Util\BasePath;
class BasePathTest extends MockedTest
{
/**
* Test the basepath determination
*/
public function testDetermineBasePath()
{
$serverArr = ['DOCUMENT_ROOT' => '/invalid', 'PWD' => '/invalid2'];
$this->assertEquals('/valid', BasePath::create('/valid', $serverArr));
}
/**
* Test the basepath determination with DOCUMENT_ROOT and PWD
*/
public function testDetermineBasePathWithServer()
{
$serverArr = ['DOCUMENT_ROOT' => '/valid'];
$this->assertEquals('/valid', BasePath::create('', $serverArr));
$serverArr = ['PWD' => '/valid_too'];
$this->assertEquals('/valid_too', BasePath::create('', $serverArr));
}
}