tests/phpunit/includes/factory/class-wp-unittest-factory-for-attachment.php 1 location
|
@@ 44-51 (lines=8) @@
|
| 41 |
|
$upload = wp_upload_bits(basename($file), null, $contents); |
| 42 |
|
|
| 43 |
|
$type = ''; |
| 44 |
|
if (! empty($upload['type']) ) { |
| 45 |
|
$type = $upload['type']; |
| 46 |
|
} else { |
| 47 |
|
$mime = wp_check_filetype($upload['file']); |
| 48 |
|
if ($mime) { |
| 49 |
|
$type = $mime['type']; |
| 50 |
|
} |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
$attachment = array( |
| 54 |
|
'post_title' => basename($upload['file']), |
tests/phpunit/includes/testcase.php 1 location
|
@@ 833-840 (lines=8) @@
|
| 830 |
|
function _make_attachment($upload, $parent_post_id = 0) |
| 831 |
|
{ |
| 832 |
|
$type = ''; |
| 833 |
|
if (!empty($upload['type']) ) { |
| 834 |
|
$type = $upload['type']; |
| 835 |
|
} else { |
| 836 |
|
$mime = wp_check_filetype($upload['file']); |
| 837 |
|
if ($mime) { |
| 838 |
|
$type = $mime['type']; |
| 839 |
|
} |
| 840 |
|
} |
| 841 |
|
|
| 842 |
|
$attachment = array( |
| 843 |
|
'post_title' => basename($upload['file']), |