Index: tests/phpunit/tests/file.php
===================================================================
--- tests/phpunit/tests/file.php	(revision 42428)
+++ tests/phpunit/tests/file.php	(revision )
@@ -8,7 +8,7 @@
 	function setUp() {
 		parent::setUp();
 
-		$file      = tempnam( '/tmp', 'foo' );
+		$file      = tempnam( DIR_TEST_TMP, 'foo' );
 		$this->dir = dirname( $file );
 		unlink( $file );
 
Index: tests/phpunit/tests/widgets/media-widget.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/widgets/media-widget.php	(revision 42428)
+++ tests/phpunit/tests/widgets/media-widget.php	(revision )
@@ -137,7 +137,7 @@
 	 */
 	function test_is_attachment_with_mime_type() {
 
-		$test_image = '/tmp/canola.jpg';
+		$test_image = DIR_TEST_TMP . 'canola.jpg';
 		copy( DIR_TESTDATA . '/images/canola.jpg', $test_image );
 		$attachment_id = self::factory()->attachment->create_object(
 			array(
Index: tests/phpunit/tests/customize/manager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/customize/manager.php	(revision 42428)
+++ tests/phpunit/tests/customize/manager.php	(revision )
@@ -60,10 +60,10 @@
 		$this->undefined = new stdClass();
 
 		$orig_file       = DIR_TESTDATA . '/images/canola.jpg';
-		$this->test_file = '/tmp/canola.jpg';
+		$this->test_file = DIR_TEST_TMP . 'canola.jpg';
 		copy( $orig_file, $this->test_file );
 		$orig_file2       = DIR_TESTDATA . '/images/waffles.jpg';
-		$this->test_file2 = '/tmp/waffles.jpg';
+		$this->test_file2 = DIR_TEST_TMP . 'waffles.jpg';
 		copy( $orig_file2, $this->test_file2 );
 	}
 
Index: tests/phpunit/tests/upload.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/upload.php	(revision 42428)
+++ tests/phpunit/tests/upload.php	(revision )
@@ -46,7 +46,7 @@
 	 * @ticket 5953
 	 */
 	function test_upload_dir_absolute() {
-		$path = '/tmp/wp-unit-test';
+		$path = DIR_TEST_TMP . 'wp-unit-test';
 
 		// wp_upload_dir() with an absolute upload path
 		update_option( 'upload_path', $path );
Index: tests/phpunit/tests/widgets/media-gallery-widget.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/widgets/media-gallery-widget.php	(revision 42428)
+++ tests/phpunit/tests/widgets/media-gallery-widget.php	(revision )
@@ -58,7 +58,7 @@
 
 		$attachments = array();
 		foreach ( array( 'canola.jpg', 'waffles.jpg' ) as $filename ) {
-			$test_image = '/tmp/' . $filename;
+			$test_image = DIR_TEST_TMP . $filename;
 			copy( DIR_TESTDATA . '/images/canola.jpg', $test_image );
 			$attachment_id = self::factory()->attachment->create_object(
 				array(
Index: tests/phpunit/tests/widgets/media-image-widget.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/widgets/media-image-widget.php	(revision 42428)
+++ tests/phpunit/tests/widgets/media-image-widget.php	(revision )
@@ -357,7 +357,7 @@
 	function test_render_media() {
 		$widget = new WP_Widget_Media_Image();
 
-		$test_image = '/tmp/canola.jpg';
+		$test_image = DIR_TEST_TMP . 'canola.jpg';
 		copy( DIR_TESTDATA . '/images/canola.jpg', $test_image );
 		$attachment_id = self::factory()->attachment->create_object(
 			array(
Index: tests/phpunit/tests/image/functions.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/image/functions.php	(revision 42428)
+++ tests/phpunit/tests/image/functions.php	(revision )
@@ -20,7 +20,7 @@
 		include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' );
 
 		// Ensure no legacy / failed tests detritus.
-		$folder = '/tmp/wordpress-gsoc-flyer*.{jpg,pdf}';
+		$folder = DIR_TEST_TMP . 'wordpress-gsoc-flyer*.{jpg,pdf}';
 
 		foreach ( glob( $folder, GLOB_BRACE ) as $file ) {
 			unlink( $file );
@@ -384,7 +384,7 @@
 		}
 
 		$orig_file = DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf';
-		$test_file = '/tmp/wordpress-gsoc-flyer.pdf';
+		$test_file = DIR_TEST_TMP . 'wordpress-gsoc-flyer.pdf';
 		copy( $orig_file, $test_file );
 
 		$attachment_id = $this->factory->attachment->create_object(
@@ -429,7 +429,7 @@
 
 		unlink( $test_file );
 		foreach ( $metadata['sizes'] as $size ) {
-			unlink( '/tmp/' . $size['file'] );
+			unlink( DIR_TEST_TMP . $size['file'] );
 		}
 	}
 
@@ -442,7 +442,7 @@
 		}
 
 		$orig_file = DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf';
-		$test_file = '/tmp/wordpress-gsoc-flyer.pdf';
+		$test_file = DIR_TEST_TMP . 'wordpress-gsoc-flyer.pdf';
 		copy( $orig_file, $test_file );
 
 		$attachment_id = $this->factory->attachment->create_object(
@@ -472,7 +472,7 @@
 
 		unlink( $test_file );
 		foreach ( $metadata['sizes'] as $size ) {
-			unlink( '/tmp/' . $size['file'] );
+			unlink( DIR_TEST_TMP . $size['file'] );
 		}
 	}
 
@@ -494,13 +494,13 @@
 		}
 
 		// Dummy JPEGs.
-		$jpg1_path = '/tmp/test.jpg'; // Straight.
+		$jpg1_path = DIR_TEST_TMP . 'test.jpg'; // Straight.
 		file_put_contents( $jpg1_path, 'asdf' );
-		$jpg2_path = '/tmp/test-pdf.jpg'; // With PDF marker.
+		$jpg2_path = DIR_TEST_TMP . 'test-pdf.jpg'; // With PDF marker.
 		file_put_contents( $jpg2_path, 'fdsa' );
 
 		// PDF with same name as JPEG.
-		$pdf_path = '/tmp/test.pdf';
+		$pdf_path = DIR_TEST_TMP . 'test.pdf';
 		copy( DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf', $pdf_path );
 
 		$attachment_id = $this->factory->attachment->create_object(
@@ -510,7 +510,7 @@
 		);
 
 		$metadata     = wp_generate_attachment_metadata( $attachment_id, $pdf_path );
-		$preview_path = '/tmp/' . $metadata['sizes']['full']['file'];
+		$preview_path = DIR_TEST_TMP . $metadata['sizes']['full']['file'];
 
 		// PDF preview didn't overwrite PDF.
 		$this->assertNotEquals( $pdf_path, $preview_path );
@@ -526,7 +526,7 @@
 		unlink( $jpg2_path );
 		unlink( $pdf_path );
 		foreach ( $metadata['sizes'] as $size ) {
-			unlink( '/tmp/' . $size['file'] );
+			unlink( DIR_TEST_TMP . $size['file'] );
 		}
 	}
 }
Index: tests/phpunit/includes/bootstrap.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/includes/bootstrap.php	(revision 42428)
+++ tests/phpunit/includes/bootstrap.php	(revision )
@@ -37,6 +37,13 @@
 define( 'WP_TESTS_TABLE_PREFIX', $table_prefix );
 define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' );
 
+if ( defined( 'PHP_OS' ) && 'win' == strtolower( substr( PHP_OS, 0, 3 ) ) ) {
+	define( 'DIR_TEST_TMP', 'C:/Windows/Temp/' );
+}
+else {
+	define( 'DIR_TEST_TMP', '/tmp/' );
+}
+
 define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' );
 
 if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) {
Index: tests/phpunit/tests/rest-api/rest-attachments-controller.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/rest-api/rest-attachments-controller.php	(revision 42428)
+++ tests/phpunit/tests/rest-api/rest-attachments-controller.php	(revision )
@@ -68,10 +68,10 @@
 		$role->add_cap( 'level_0' );
 
 		$orig_file       = DIR_TESTDATA . '/images/canola.jpg';
-		$this->test_file = '/tmp/canola.jpg';
+		$this->test_file = DIR_TEST_TMP . 'canola.jpg';
 		copy( $orig_file, $this->test_file );
 		$orig_file2       = DIR_TESTDATA . '/images/codeispoetry.png';
-		$this->test_file2 = '/tmp/codeispoetry.png';
+		$this->test_file2 = DIR_TEST_TMP . 'codeispoetry.png';
 		copy( $orig_file2, $this->test_file2 );
 	}
 
