Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/__tests__/AphrontRequestTestCase.php
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | public function testFlattenRequestData() { | ||||
for ($ii = 0; $ii < count($test_cases); $ii += 2) { | for ($ii = 0; $ii < count($test_cases); $ii += 2) { | ||||
$input = $test_cases[$ii]; | $input = $test_cases[$ii]; | ||||
$expect = $test_cases[$ii + 1]; | $expect = $test_cases[$ii + 1]; | ||||
$this->assertEqual($expect, AphrontRequest::flattenData($input)); | $this->assertEqual($expect, AphrontRequest::flattenData($input)); | ||||
} | } | ||||
} | } | ||||
public function testGetHTTPHeader() { | |||||
$server_data = array( | |||||
'HTTP_ACCEPT_ENCODING' => 'duck/quack', | |||||
'CONTENT_TYPE' => 'cow/moo', | |||||
); | |||||
$this->assertEqual( | |||||
'duck/quack', | |||||
AphrontRequest::getHTTPHeader('AcCePt-EncOdING', null, $server_data)); | |||||
$this->assertEqual( | |||||
'cow/moo', | |||||
AphrontRequest::getHTTPHeader('cONTent-TyPE', null, $server_data)); | |||||
$this->assertEqual( | |||||
null, | |||||
AphrontRequest::getHTTPHeader('Pie-Flavor', null, $server_data)); | |||||
} | |||||
} | } |