phpunit: pass when single test is run, fails when all tests are run

I have the problem that a specific test runs when I execute only this test. When I run all the tests together this test fails. Running from within NetBeans or from the command line has the same result.

The thing which is unique about this test compared to other tests in my suite is that it takes a file from a resources folder and then copies it to a test folder (which is created in the the beginning of the test and destroyed at the end).

I thought it was a problem with relative/absolute paths, but when I dump the source and target folders they are the same.

//create the link between a requirement and a file
TRHUtil::RequirementFileLink($reqID, $fileID, $userID);

//assert that there is one record, then check the structure and then the contents
$this->assertEquals(1, DB::getRecordCount($dbName.'.files_reqs'));
$this->assertEquals(1, TRHUtil::RequirementFileLinkPresent($reqID, $dbName));
$this->assertEquals(1, TRHUtil::RequirementFileLinkCheck($reqID, $fileID, $dbName));
$this->assertEquals(1, count(TRHUtil::GetRequirementFileLinkID($reqID, $dbName)));

TRHUtil::RemoveRequirementFile($reqID, $dbName, $trhVersionID);

//assert that the records about this file are removed and that the folder where the file was staying is also removed
$this->assertEquals(0, DB::getRecordCount($dbName.'.files_reqs'));
$this->assertEquals(0, TRHUtil::RequirementFileLinkPresent($reqID, $dbName));
$this->assertEquals(0, TRHUtil::RequirementFileLinkCheck($reqID, $fileID, $dbName));
$this->assertEquals(0, TRHUtil::GetRequirementFileLinkID($reqID, $dbName));
$this->assertEquals(0, is_dir($targetFolder));

Which corresponds to the folder: D:\Inetpub\wwwroot\DTSfiles\TRHUtilTest\trh\reqs\3\1\

Since the start location of running this one unit test is different as the root folder where all the tests are residing is different (the root-test-folder is two directory levels deeper) the target folder was indeed created, but at a wrong level.

Thanks to all for the support.

Email codedump link for phpunit: pass when single test is run, fails when all tests are run