IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
137 | 137 | */ |
138 | 138 | function test_is_attachment_with_mime_type() { |
139 | 139 | |
140 | | $test_image = '/tmp/canola.jpg'; |
| 140 | $test_image = DIR_TEST_TMP . 'canola.jpg'; |
141 | 141 | copy( DIR_TESTDATA . '/images/canola.jpg', $test_image ); |
142 | 142 | $attachment_id = self::factory()->attachment->create_object( |
143 | 143 | array( |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
60 | 60 | $this->undefined = new stdClass(); |
61 | 61 | |
62 | 62 | $orig_file = DIR_TESTDATA . '/images/canola.jpg'; |
63 | | $this->test_file = '/tmp/canola.jpg'; |
| 63 | $this->test_file = DIR_TEST_TMP . 'canola.jpg'; |
64 | 64 | copy( $orig_file, $this->test_file ); |
65 | 65 | $orig_file2 = DIR_TESTDATA . '/images/waffles.jpg'; |
66 | | $this->test_file2 = '/tmp/waffles.jpg'; |
| 66 | $this->test_file2 = DIR_TEST_TMP . 'waffles.jpg'; |
67 | 67 | copy( $orig_file2, $this->test_file2 ); |
68 | 68 | } |
69 | 69 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
46 | 46 | * @ticket 5953 |
47 | 47 | */ |
48 | 48 | function test_upload_dir_absolute() { |
49 | | $path = '/tmp/wp-unit-test'; |
| 49 | $path = DIR_TEST_TMP . 'wp-unit-test'; |
50 | 50 | |
51 | 51 | // wp_upload_dir() with an absolute upload path |
52 | 52 | update_option( 'upload_path', $path ); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
58 | 58 | |
59 | 59 | $attachments = array(); |
60 | 60 | foreach ( array( 'canola.jpg', 'waffles.jpg' ) as $filename ) { |
61 | | $test_image = '/tmp/' . $filename; |
| 61 | $test_image = DIR_TEST_TMP . $filename; |
62 | 62 | copy( DIR_TESTDATA . '/images/canola.jpg', $test_image ); |
63 | 63 | $attachment_id = self::factory()->attachment->create_object( |
64 | 64 | array( |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
357 | 357 | function test_render_media() { |
358 | 358 | $widget = new WP_Widget_Media_Image(); |
359 | 359 | |
360 | | $test_image = '/tmp/canola.jpg'; |
| 360 | $test_image = DIR_TEST_TMP . 'canola.jpg'; |
361 | 361 | copy( DIR_TESTDATA . '/images/canola.jpg', $test_image ); |
362 | 362 | $attachment_id = self::factory()->attachment->create_object( |
363 | 363 | array( |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
20 | 20 | include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' ); |
21 | 21 | |
22 | 22 | // Ensure no legacy / failed tests detritus. |
23 | | $folder = '/tmp/wordpress-gsoc-flyer*.{jpg,pdf}'; |
| 23 | $folder = DIR_TEST_TMP . 'wordpress-gsoc-flyer*.{jpg,pdf}'; |
24 | 24 | |
25 | 25 | foreach ( glob( $folder, GLOB_BRACE ) as $file ) { |
26 | 26 | unlink( $file ); |
… |
… |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | $orig_file = DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf'; |
387 | | $test_file = '/tmp/wordpress-gsoc-flyer.pdf'; |
| 387 | $test_file = DIR_TEST_TMP . 'wordpress-gsoc-flyer.pdf'; |
388 | 388 | copy( $orig_file, $test_file ); |
389 | 389 | |
390 | 390 | $attachment_id = $this->factory->attachment->create_object( |
… |
… |
|
429 | 429 | |
430 | 430 | unlink( $test_file ); |
431 | 431 | foreach ( $metadata['sizes'] as $size ) { |
432 | | unlink( '/tmp/' . $size['file'] ); |
| 432 | unlink( DIR_TEST_TMP . $size['file'] ); |
433 | 433 | } |
434 | 434 | } |
435 | 435 | |
… |
… |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | $orig_file = DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf'; |
445 | | $test_file = '/tmp/wordpress-gsoc-flyer.pdf'; |
| 445 | $test_file = DIR_TEST_TMP . 'wordpress-gsoc-flyer.pdf'; |
446 | 446 | copy( $orig_file, $test_file ); |
447 | 447 | |
448 | 448 | $attachment_id = $this->factory->attachment->create_object( |
… |
… |
|
472 | 472 | |
473 | 473 | unlink( $test_file ); |
474 | 474 | foreach ( $metadata['sizes'] as $size ) { |
475 | | unlink( '/tmp/' . $size['file'] ); |
| 475 | unlink( DIR_TEST_TMP . $size['file'] ); |
476 | 476 | } |
477 | 477 | } |
478 | 478 | |
… |
… |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | // Dummy JPEGs. |
497 | | $jpg1_path = '/tmp/test.jpg'; // Straight. |
| 497 | $jpg1_path = DIR_TEST_TMP . 'test.jpg'; // Straight. |
498 | 498 | file_put_contents( $jpg1_path, 'asdf' ); |
499 | | $jpg2_path = '/tmp/test-pdf.jpg'; // With PDF marker. |
| 499 | $jpg2_path = DIR_TEST_TMP . 'test-pdf.jpg'; // With PDF marker. |
500 | 500 | file_put_contents( $jpg2_path, 'fdsa' ); |
501 | 501 | |
502 | 502 | // PDF with same name as JPEG. |
503 | | $pdf_path = '/tmp/test.pdf'; |
| 503 | $pdf_path = DIR_TEST_TMP . 'test.pdf'; |
504 | 504 | copy( DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf', $pdf_path ); |
505 | 505 | |
506 | 506 | $attachment_id = $this->factory->attachment->create_object( |
… |
… |
|
510 | 510 | ); |
511 | 511 | |
512 | 512 | $metadata = wp_generate_attachment_metadata( $attachment_id, $pdf_path ); |
513 | | $preview_path = '/tmp/' . $metadata['sizes']['full']['file']; |
| 513 | $preview_path = DIR_TEST_TMP . $metadata['sizes']['full']['file']; |
514 | 514 | |
515 | 515 | // PDF preview didn't overwrite PDF. |
516 | 516 | $this->assertNotEquals( $pdf_path, $preview_path ); |
… |
… |
|
526 | 526 | unlink( $jpg2_path ); |
527 | 527 | unlink( $pdf_path ); |
528 | 528 | foreach ( $metadata['sizes'] as $size ) { |
529 | | unlink( '/tmp/' . $size['file'] ); |
| 529 | unlink( DIR_TEST_TMP . $size['file'] ); |
530 | 530 | } |
531 | 531 | } |
532 | 532 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
37 | 37 | define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); |
38 | 38 | define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' ); |
39 | 39 | |
| 40 | if ( defined( 'PHP_OS' ) && 'win' == strtolower( substr( PHP_OS, 0, 3 ) ) ) { |
| 41 | define( 'DIR_TEST_TMP', 'C:/Windows/Temp/' ); |
| 42 | } |
| 43 | else { |
| 44 | define( 'DIR_TEST_TMP', '/tmp/' ); |
| 45 | } |
| 46 | |
40 | 47 | define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' ); |
41 | 48 | |
42 | 49 | if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) { |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
68 | 68 | $role->add_cap( 'level_0' ); |
69 | 69 | |
70 | 70 | $orig_file = DIR_TESTDATA . '/images/canola.jpg'; |
71 | | $this->test_file = '/tmp/canola.jpg'; |
| 71 | $this->test_file = DIR_TEST_TMP . 'canola.jpg'; |
72 | 72 | copy( $orig_file, $this->test_file ); |
73 | 73 | $orig_file2 = DIR_TESTDATA . '/images/codeispoetry.png'; |
74 | | $this->test_file2 = '/tmp/codeispoetry.png'; |
| 74 | $this->test_file2 = DIR_TEST_TMP . 'codeispoetry.png'; |
75 | 75 | copy( $orig_file2, $this->test_file2 ); |
76 | 76 | } |
77 | 77 | |