public function testDataWithNoEndingDoubleNewline()
 {
     $requestParser = new RequestParser();
     $result = $requestParser->addData("GET /democracy/init HTTP/1.1\r\nUser-Agent: The Illuminati/2.0\r\nContent-Length: 10");
     $this->assertTrue($result);
     $this->assertTrue($requestParser->isFullyRead());
     $this->assertEquals(RequestParser::BAD_REQUEST, $requestParser->getStatus());
     $exported = $requestParser->exportRequestState();
     $requestState = new RequestState();
     $requestStateExported = $requestState->exportState();
     unset($requestStateExported['startTime']);
     $this->assertEquals(true, isset($exported['startTime']));
     $this->assertEquals(true, is_float($exported['startTime']));
     unset($exported['startTime']);
     // Unset StartTime because that value can't be provided from external source.
     $this->assertEquals($requestStateExported, $exported);
 }
 public function testRequestStateExportsProperties()
 {
     $requestState = new RequestState();
     $requestState->method = "GET";
     $requestState->scheme = "http";
     $requestState->path = "/slug-character-with-000-numbers";
     $requestState->query = NULL;
     $requestState->_POST['session_key'] = "buffer_overflow_attack";
     $requestState->user = false;
     $state = $requestState->exportState();
     $this->assertEquals("GET", $state['method']);
     $this->assertEquals("http", $state['scheme']);
     $this->assertEquals("/slug-character-with-000-numbers", $state['path']);
     $this->assertEquals(NULL, $state['query']);
     $this->assertEquals(array('session_key' => "buffer_overflow_attack"), $state['_POST']);
     $this->assertEquals(false, $state['user']);
 }