So maybe I'm not getting how PHP includes work. I have a file structure like this:
app--|
|
-classes-|
-PHPMyClass.php
|
-includes-|
-PHPMyInclude.php
|
-functions-|
-TestFunctions-|
-PHPCallTestOnMyClass.php
so in PHPMyClass.php I do this:
<?php
require_once '../includes/PHPMyInclude.php';
and if I test my PHPMyClass.php directly it works fine, e.g., it properly locates PHPMyInclude.php
however, if I attempt to include PHPMyClass.php in my PHPCallTestOnMyClass.php script, the load will fail since it can't find '../includes/PHPMyInclude.php' since it appears to be trying to reference this from the root of app/functions/testfunctions, which of course will not resolve properly. How do I manage locations in php layouts? I've resorted to taking the includes out of the sub files and hardcoding the includes into the PHPCallTestOnMyClass.php code, e.g.,
<?php
require_once '../../includes/PHPMyInclude.php';
require_once '../../classes/PHPMyClass.php';
but this seems unnecessarily complicated and unsupportable. What am I missing?
I'm also running into this same problem when trying to use phpunit. There has to be something I'm just goofing up.