So I want to test a function that uses the Advanced Custom Fields plugin.
Unit tests using PHPunit work just fine as long as the test function is called directly, or from the test class.
However the ACF get_field call fails to work (returns false) when the tests are run by calling the directory they’re stored in. It returns the correct value when called the other two ways.
Other tests are working fine; it’s definitely the interaction of ACF and PHPunit called on a directory that’s being weird.
Sure, I could mock ACF. I probably will. But I’d really like to know why it fails when PHPunit is called on the directory, and not in any other way.