/** * Ensure that the preserveRequest method properly preserves the REQUEST object * @return void * @depends testRetrieveRequest */ public function testPreserveRequest() { if (empty($_SESSION)) { $_SESSION = array(); } $this->request->preserveRequest('unit-test'); $request = $this->request->retrieveRequest('unit-test'); $this->assertNotEmpty($request, 'modRequest.preserveRequest did not correctly preserve the REQUEST data.'); $this->assertArrayHasKey('testRequest', $request, 'modRequest.preserveRequest did not preserve the correct REQUEST data, as it does not contain a valid REQUEST field.'); unset($_SESSION['modx.request.unit-test']); }