Index: tests/headRequest.php
===================================================================
--- tests/headRequest.php	(revision 0)
+++ tests/headRequest.php	(revision 0)
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * Detect when wp_die was called
+ */
+class WPHeadDieException extends Exception {};
+
+/**
+ * Some simple test cases for KSES post content filtering
+ *
+ * @group templates
+ * @ticket 14348
+ */
+class Tests_HeadRequest extends WP_UnitTestCase {
+
+	/**
+	 * Set up the test fixture
+	 * Hook up the die handler override
+	 */
+	public function setup() {
+		$_SERVER['REQUEST_METHOD'] = 'HEAD';
+		add_filter( 'wp_die_handler', array( $this, 'override_die' ), 99 );
+	}
+	
+	/**
+	 * Tear down the test fixture
+	 * Unhook the die handler override
+	 */
+	public function teardown() {
+		remove_filter( 'wp_die_handler', array( $this, 'override_die'), 99 );
+	}
+	
+	/**
+	 * Test that the HEAD requests die early
+	 */
+	public function test_head_quits_early() {
+		$this->setExpectedException( 'WPHeadDieException', '' );
+		do_action( 'head_request' );
+	}
+	
+	/**
+	 * Test that the page doesn't create any output
+	 */
+	public function test_page_is_empty() {
+		ob_start();
+		try {
+			do_action( 'head_request' );
+			$this->fail( 'Did not die early' );
+		} catch ( WPHeadDieException $e ) {
+		}
+		$contents = ob_get_clean();
+		$this->assertEmpty( $contents );
+	}
+	
+	/**
+	 * Test the exit_on_http_head filter
+	 */
+	public function test_exit_on_http_head_filter() {
+		ob_start();
+		add_filter( 'exit_on_http_head', '__return_false' );
+		try {
+			do_action( 'head_request' );
+			remove_filter( 'exit_on_http_head', '__return_false' );
+			$this->assertTrue( true );
+		} catch ( WPHeadDieException $e ) {
+			remove_filter( 'exit_on_http_head', '__return_false' );
+			$this->fail( 'Did not die early' );
+		}
+		ob_end_clean();
+	}
+
+	/**
+	 * Shim in our die handler
+	 * @return callable
+	 */
+	public function override_die() {
+		return array( $this, 'fake_wp_die' );
+	}
+	
+	/**
+	 * This stops WP execution, but not test execution
+	 * @param string $message
+	 * @throws WPHeadDieException
+	 */
+	public function fake_wp_die( $message ) {
+		throw new WPHeadDieException( $message );
+	}
+}
