run drupal_get_headers, then add more headers (starting with X-) and then run it again and then assert that the difference is what you set.

CommentFileSizeAuthor
#1 common.test.patch1.7 KBdawehner

Comments

dawehner’s picture

StatusFileSize
new1.7 KB

here is a patch | it tests some static and some random headers

cwgordon7’s picture

Status: Active » Needs work

This has a few coding standards issues:

1. + * Test drupal_get_headers() should have a period at the end.
2. +class DrupalGETHeadersTestCase should be DrupalGetHeadersTestCase for consistency.
3. + * Implementation of hook_getInfo() should be + * Implementation of getInfo().
4. + ); should be less indented.
5. + function testDrupalGETHeaders() { should be + function testDrupalGetHeaders() { for consistency.
6. testDrupalGetHeaders should have a comment block.
7. All comments should begin with a capital letter and end with a period.

Also, a minor concern - won't this also *actually send out the header* during the batch request, making everything confused?

damien tournoud’s picture

Obviously this cannot work. We need to create a special test module registering a menu path that returns special headers.

catch’s picture

Component: tests » base system
Category: bug » task
Priority: Critical » Normal

Fixing the critical / pending bugs queues to reflect things which are really bugs or release critical.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.