diff --git a/tests/phpunit/tests/load/fixServerVars.php b/tests/phpunit/tests/load/fixServerVars.php
new file mode 100644
index 000000000..06146eaf7
--- /dev/null
+++ b/tests/phpunit/tests/load/fixServerVars.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * Tests for wp_convert_hr_to_bytes().
+ *
+ * @group load.php
+ */
+class Tests_Functions_Fix_Server_Vars extends WP_UnitTestCase {
+
+	/**
+	 * Tests that fallback when PHP_SELF is empty
+	 *
+	 * @ticket       34634
+	 *
+	 * @dataProvider data_wp_fix_server_vars_php_self
+	 *
+	 * @param string $expected          The expected PHP_SELF value.
+	 * @param string $php_self_value    The value for the server PHP_SELF value.
+	 * @param string $request_uri_value The value for the server REQUEST_URI.
+	 */
+	public function test_wp_fix_server_vars_php_self( $expected, $php_self_value, $request_uri_value ) {
+		// Saves the current values.
+		$PHP_SELF    = $_SERVER['PHP_SELF'];
+		$REQUEST_URI = $_SERVER['REQUEST_URI'];
+
+		// Overrides the current values.
+		$_SERVER['PHP_SELF']    =  $php_self_value;
+		$_SERVER['REQUEST_URI'] =  $request_uri_value;
+
+		wp_fix_server_vars();
+
+		$this->assertSame( $expected, $_SERVER['PHP_SELF'] );
+
+		// Put back the previous value.
+		$_SERVER['PHP_SELF']    = $PHP_SELF;
+		$_SERVER['REQUEST_URI'] = $REQUEST_URI;
+	}
+
+
+	/**
+	 * Data provider for test_wp_fix_server_vars_php_self().
+	 *
+	 * @return array {
+	 *     @type array {
+	 *         @type string $expected The expected output.
+	 *         @type string $value    The php self value.
+	 *         @type string $value    The request uri value.
+	 *     }
+	 * }
+	 */
+	public function data_wp_fix_server_vars_php_self() {
+		return array(
+			array( '/index.php', '', '' ),
+			array( '/test.php', '', '/test.php' ),
+		);
+	}
+}
