I'm integrating Codeception into an existing Yii 1.1 application. I've gotten Codeception's unit tests running, and I'm working on building up the components necessary for good functional testing, like mocking, stubs, and fixtures.
When the functional testing suite is executed, the app entry point test.php produces an error that CHttpRequest is unable to determine the request URI. The suite isn't being executed with Apache running, so it makes sense these aren't present.
I know the application is heavily reliant on PHP's superglobals, particularly _SERVER, and that Yii 1.1 hydrates itself with these values so I must mock these parameters somehow, but I am confused on how to do this.
So far, I have come across PHPUnit\Framework\TestCase's mock building, as well as AspectMock.
I think one way that I could do this is to use PHPUnit's TestCase to mock the methods from Yii's CHttpRequest, but I think this would leave parameters like _SERVER mal-defined, and the application still uses these supers frequently.
Is there a best practice or recommended method for defining globals like _SERVER? Perhaps creating a mock of _SERVER and including it into the test entry point would be sufficient?
Thanks for any help, and advancement in a sound direction.