protected function setUpControllerTestTrait(): void
{ // The URL helper is always loaded by the system so ensure it is available.
helper('url'
);
if (empty($this->appConfig
)) { $this->appConfig =
config(App::
class);
} if (!
$this->uri instanceof URI
) { $factory = Services::
siteurifactory($this->appConfig, Services::
superglobals(), false
);
$this->uri =
$factory->
createFromGlobals();
} if (empty($this->request
)) { // Do some acrobatics so we can use the Request service with our own URI
$tempUri = Services::
uri();
Services::
injectMock('uri',
$this->uri
);
$this->
withRequest(Services::
request($this->appConfig, false
));
// Restore the URI service