Add working directory search path for composer

Added a needed search path for composer.json and a test testing exactly this.
This commit is contained in:
Vassyli
2016-07-27 08:00:17 +02:00
parent f136711884
commit 396e174fb5
2 changed files with 43 additions and 3 deletions
+19
View File
@@ -29,6 +29,25 @@ class BootstrapTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($g->getEventManager());
$this->assertNotNull($g->getLogger());
}
public function testWorkingFromChildWorkingDirectory()
{
$cwd = getcwd();
$oldconf = getenv("LOTGD_CONFIG");
chdir($cwd . "/tests/");
putenv("LOTGD_CONFIG=../".$oldconf);
$this->assertStringEndsWith("/tests", getcwd());
$this->assertStringStartsWith(".././", getenv("LOTGD_CONFIG"));
$game = Bootstrap::createGame();
chdir($cwd);
putenv("LOTGD_CONFIG=" . $oldconf);
$this->assertStringEndsNotWith("/tests", getcwd());
$this->assertStringStartsNotWith(".././", getenv("LOTGD_CONFIG"));
}
public function testGenerateAnnotationDirectories()
{