I'm really at loss on what's going on - it all begun with PHPUnit error of Error: No code coverage driver is available
when trying to run test coverage report and ended with me debugging to a replicable set described below. But to set the stage - I'm using Laravel 5.5, Xdebug 2.5.5, PHPUnit 6.5.5. My test code that illustrates the issue:
<?php
use Tests\TestCase;
class A extends TestCase
{
public function testA()
{
echo( get_cfg_var('cfg_file_path')); exit;
}
}
outputs C:\Users\xxx\AppData\Local\Temp\7598.tmp
compare it to this code which outputs the correct php.ini path:
<?php
use PHPUnit\Framework\TestCase;
class A extends TestCase
{
public function testA()
{
echo( get_cfg_var('cfg_file_path')); exit;
}
}
outputs: C:\server\php\php.ini
How can it be? How can loaded php.ini file change dependant upon the executed code? Better yet - how can my correct php.ini file (that has xdebug enabled) be loaded, instead of this imposter?
In both cases tests are launched using phpunit tests\unit\a
Folder structure is:
Laravel Project
└───tests
└───Unit
└───A.php