<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[49025] trunk/tests/phpunit/tests: Tests: Convert a few more `function_exists()` and `extension_loaded()` checks to `@requires` annotations.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/49025">49025</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/49025","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-09-21 13:25:38 +0000 (Mon, 21 Sep 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Tests: Convert a few more `function_exists()` and `extension_loaded()` checks to `@requires` annotations.
This better utilizes the PHPUnit native functionality.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/49024">[49024]</a>.
See <a href="https://core.trac.wordpress.org/ticket/50639">#50639</a>, <a href="https://core.trac.wordpress.org/ticket/50640">#50640</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsajaxCompressionphp">trunk/tests/phpunit/tests/ajax/Compression.php</a></li>
<li><a href="#trunktestsphpunittestsajaxResponsephp">trunk/tests/phpunit/tests/ajax/Response.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsanonymizationphp">trunk/tests/phpunit/tests/functions/anonymization.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsphp">trunk/tests/phpunit/tests/functions.php</a></li>
<li><a href="#trunktestsphpunittestshttpfunctionsphp">trunk/tests/phpunit/tests/http/functions.php</a></li>
<li><a href="#trunktestsphpunittestsimageeditorImagickphp">trunk/tests/phpunit/tests/image/editorImagick.php</a></li>
<li><a href="#trunktestsphpunittestsimagefunctionsphp">trunk/tests/phpunit/tests/image/functions.php</a></li>
<li><a href="#trunktestsphpunittestsimagemetaphp">trunk/tests/phpunit/tests/image/meta.php</a></li>
<li><a href="#trunktestsphpunittestsoembedheadersphp">trunk/tests/phpunit/tests/oembed/headers.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestsajaxCompressionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/ajax/Compression.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/Compression.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/ajax/Compression.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,13 +54,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fetch the test text (gzdeflate)
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @requires function gzdeflate
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_gzdeflate() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'gzdeflate' ) ) {
- $this->fail( 'gzdeflate function not available' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Become an administrator.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_setRole( 'administrator' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,13 +79,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fetch the test text (gzencode)
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @requires function gzencode
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_gzencode() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'gzencode' ) ) {
- $this->fail( 'gzencode function not available' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Become an administrator.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_setRole( 'administrator' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxResponsephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/ajax/Response.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/Response.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/ajax/Response.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,13 +70,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @runInSeparateProcess
</span><span class="cx" style="display: block; padding: 0 10px"> * @preserveGlobalState disabled
</span><span class="cx" style="display: block; padding: 0 10px"> * @group xdebug
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires function xdebug_get_headers
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_response_charset_in_header() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'xdebug_get_headers' ) ) {
- $this->markTestSkipped( 'xdebug is required for this test' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Generate an Ajax response.
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $ajax_response = new WP_Ajax_Response();
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsanonymizationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/functions/anonymization.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/anonymization.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/functions/anonymization.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,15 +25,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 41083
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43545
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires function inet_ntop
+ * @requires function inet_pton
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $raw_ip Raw IP address.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected_result Expected result.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_privacy_anonymize_ip( $raw_ip, $expected_result ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'inet_ntop' ) || ! function_exists( 'inet_pton' ) ) {
- $this->markTestSkipped( 'This test requires both the inet_ntop() and inet_pton() functions.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $actual_result = wp_privacy_anonymize_data( 'ip', $raw_ip );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Todo test ipv6_fallback mode if keeping it.*/
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/functions.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -942,12 +942,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28786
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires function mb_detect_order
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_json_encode_non_utf8() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'mb_detect_order' ) ) {
- $this->markTestSkipped( 'mbstring extension not available.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $charsets = mb_detect_order();
</span><span class="cx" style="display: block; padding: 0 10px"> $old_charsets = $charsets;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( 'EUC-JP', $charsets, true ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -967,12 +964,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28786
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires function mb_detect_order
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_json_encode_non_utf8_in_array() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'mb_detect_order' ) ) {
- $this->markTestSkipped( 'mbstring extension not available.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $charsets = mb_detect_order();
</span><span class="cx" style="display: block; padding: 0 10px"> $old_charsets = $charsets;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( 'EUC-JP', $charsets, true ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1210,12 +1204,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 39550
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider _wp_check_filetype_and_ext_data
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension fileinfo
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_check_filetype_and_ext( $file, $filename, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'fileinfo' ) ) {
- $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, wp_check_filetype_and_ext( $file, $filename ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1222,12 +1213,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 39550
</span><span class="cx" style="display: block; padding: 0 10px"> * @group ms-excluded
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension fileinfo
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_check_filetype_and_ext_with_filtered_svg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'fileinfo' ) ) {
- $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $file = DIR_TESTDATA . '/uploads/video-play.svg';
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = 'video-play.svg';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1247,12 +1235,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 39550
</span><span class="cx" style="display: block; padding: 0 10px"> * @group ms-excluded
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension fileinfo
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_check_filetype_and_ext_with_filtered_woff() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'fileinfo' ) ) {
- $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $file = DIR_TESTDATA . '/uploads/dashicons.woff';
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = 'dashicons.woff';
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestshttpfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/http/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/functions.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/http/functions.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3,17 +3,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @group http
</span><span class="cx" style="display: block; padding: 0 10px"> * @group external-http
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension openssl
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_HTTP_Functions extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function setUp() {
- if ( ! extension_loaded( 'openssl' ) ) {
- $this->markTestSkipped( 'Tests_HTTP_Functions requires openssl.' );
- }
-
- parent::setUp();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function test_head_request() {
</span><span class="cx" style="display: block; padding: 0 10px"> // This URL gives a direct 200 response.
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
</span></span></pre></div>
<a id="trunktestsphpunittestsimageeditorImagickphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/editorImagick.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/editorImagick.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/image/editorImagick.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -548,12 +548,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test resetting Exif orientation data on rotate
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 37140
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires function exif_read_data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_orientation_data_on_rotate() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'exif_read_data' ) ) {
- $this->markTestSkipped( 'This test requires the exif_read_data function.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $file = DIR_TESTDATA . '/images/test-image-upside-down.jpg';
</span><span class="cx" style="display: block; padding: 0 10px"> $data = wp_read_image_metadata( $file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsimagefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/functions.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/image/functions.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,12 +149,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test save image file and mime_types
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 6821
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension fileinfo
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_save_image_file() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'fileinfo' ) ) {
- $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $classes as $key => $class ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,12 +205,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test that a passed mime type overrides the extension in the filename
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 6821
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension fileinfo
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_mime_overrides_filename() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'fileinfo' ) ) {
- $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $classes as $key => $class ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,12 +247,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test that mime types are correctly inferred from file extensions
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 6821
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension fileinfo
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_inferred_mime_types() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'fileinfo' ) ) {
- $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $classes as $key => $class ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,12 +364,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @requires function imagejpeg
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension openssl
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_crop_image_url() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'openssl' ) ) {
- $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url() requires openssl.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $file = wp_crop_image(
</span><span class="cx" style="display: block; padding: 0 10px"> 'https://asdftestblog1.files.wordpress.com/2008/04/canola.jpg',
</span><span class="cx" style="display: block; padding: 0 10px"> 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -418,11 +406,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $file );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @requires extension openssl
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_crop_image_url_not_exist() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! extension_loaded( 'openssl' ) ) {
- $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url_not_exist() requires openssl.' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $file = wp_crop_image(
</span><span class="cx" style="display: block; padding: 0 10px"> 'https://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg',
</span><span class="cx" style="display: block; padding: 0 10px"> 0,
</span></span></pre></div>
<a id="trunktestsphpunittestsimagemetaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/meta.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/image/meta.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,19 +4,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @group image
</span><span class="cx" style="display: block; padding: 0 10px"> * @group media
</span><span class="cx" style="display: block; padding: 0 10px"> * @group upload
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @requires extension gd
+ * @requires extension exif
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Image_Meta extends WP_UnitTestCase {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function setUp() {
- if ( ! extension_loaded( 'gd' ) ) {
- $this->markTestSkipped( 'The gd PHP extension is not loaded.' );
- }
- if ( ! extension_loaded( 'exif' ) ) {
- $this->markTestSkipped( 'The exif PHP extension is not loaded.' );
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent::setUp();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function test_exif_d70() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Exif from a Nikon D70.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/2004-07-22-DSC_0008.jpg' );
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedheadersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/oembed/headers.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/headers.php 2020-09-21 11:34:06 UTC (rev 49024)
+++ trunk/tests/phpunit/tests/oembed/headers.php 2020-09-21 13:25:38 UTC (rev 49025)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,11 +8,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @group xdebug
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_oEmbed_HTTP_Headers extends WP_UnitTestCase {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @requires function xdebug_get_headers
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> function test_rest_pre_serve_request_headers() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'xdebug_get_headers' ) ) {
- $this->markTestSkipped( 'xdebug is required for this test' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $post = $this->factory()->post->create_and_get(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_title' => 'Hello World',
</span></span></pre>
</div>
</div>
</body>
</html>