public function testNameNormalizing() { // Test data $header = 'content_TYPE'; // Ignore our deprecation error $old_error_val = error_reporting(); error_reporting(E_ALL ^ E_USER_DEPRECATED); $normalized_key = HeaderDataCollection::normalizeName($header); $normalized_key_without_canonicalization = HeaderDataCollection::normalizeName($header, false); error_reporting($old_error_val); $this->assertNotSame($header, $normalized_key); $this->assertSame('content-type', $normalized_key); $this->assertSame('content-TYPE', $normalized_key_without_canonicalization); }
public function testNameNormalizing() { // Test data $data = array('DOG_NAME' => 'cooper'); // Create our collection with NO data $normalized_key = HeaderDataCollection::normalizeName(key($data)); $normalized_val = HeaderDataCollection::normalizeName(current($data)); $this->assertNotSame(key($data), $normalized_key); $this->assertSame(current($data), $normalized_val); $normalized_key_without_case_change = HeaderDataCollection::normalizeName(key($data), false); $this->assertTrue(strpos($normalized_key_without_case_change, 'D') !== false); $this->assertTrue(strpos($normalized_key_without_case_change, 'd') === false); $this->assertTrue(strpos($normalized_key, 'd') !== false); $this->assertTrue(strpos($normalized_key, 'D') === false); }