I have a very simple PHP file that is part of a unit test with PHPUnit, and I am getting an issue where require() reports back that it is unable to open the stream because no such file exists, but yet, on the next line tests if the file_exists and this returns true?
<?php
$inc1 = $_SERVER['DOCUMENT_ROOT'].'/vendor/autoload.php';
require $inc1;
if (file_exists($inc1)){
echo "yes";
}else
{
echo "no";
}
What could be causing this behavior and for this to not work?
The exact error being returned by the console is:
Warning: require(/vendor/autoload.php): failed to open stream: No such file or directory in /Users/REDACTED/Documents/Github/XXX/tests/inc/emailSendTest.php on line 3
Fatal error: require(): Failed opening required '/vendor/autoload.php' (include_path='.:') in /Users/REDACTED/Documents/Github/XXX/tests/inc/emailSendTest.php on line 3