I'm coding a functional test that calls a route whose controller has to read on local file system a specific file. The code in my controller is:
$document_root = $_SERVER['DOCUMENT_ROOT'];
$patch = $document_root . "/../app/config/tabelle/config.json";
if (file_exists($patch)) { ... }else{ die; }
The problem is that when I run the controller visiting by myself the URL and loading the page on my browser, everything works properly. But when I run my functional test, that is supposed to load exactly the same URL I visited manually by browser, the test fails because controller cannot find the file. Maybe I have to configure phpunit in a way that tells him which root folder he has to consider? Thanks