<!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>[55029] trunk: Tests: Bring some consistency to mocking HTTP requests in unit tests.</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/55029">55029</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/55029","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>2023-01-05 10:21:19 +0000 (Thu, 05 Jan 2023)</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: Bring some consistency to mocking HTTP requests in unit tests.
Includes:
* Renaming the `$preempt` parameter to `$response` in the `pre_http_request` filter to better match the context used in callbacks (returning the original value if the conditions are not met rather than preempting the request).
* Synchronizing parameter names and types in various `pre_http_request` callbacks in unit tests.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/34509">[34509]</a>, <a href="https://core.trac.wordpress.org/changeset/37907">[37907]</a>, <a href="https://core.trac.wordpress.org/changeset/40628">[40628]</a>, <a href="https://core.trac.wordpress.org/changeset/40629">[40629]</a>, <a href="https://core.trac.wordpress.org/changeset/45667">[45667]</a>, <a href="https://core.trac.wordpress.org/changeset/46175">[46175]</a>, <a href="https://core.trac.wordpress.org/changeset/48242">[48242]</a>, <a href="https://core.trac.wordpress.org/changeset/48462">[48462]</a>, <a href="https://core.trac.wordpress.org/changeset/49904">[49904]</a>, <a href="https://core.trac.wordpress.org/changeset/51021">[51021]</a>, <a href="https://core.trac.wordpress.org/changeset/51973">[51973]</a>, <a href="https://core.trac.wordpress.org/changeset/52146">[52146]</a>, <a href="https://core.trac.wordpress.org/changeset/52382">[52382]</a>, <a href="https://core.trac.wordpress.org/changeset/54043">[540
43]</a>, <a href="https://core.trac.wordpress.org/changeset/54968">[54968]</a>.
See <a href="https://core.trac.wordpress.org/ticket/56793">#56793</a>, <a href="https://core.trac.wordpress.org/ticket/56792">#56792</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswphttpphp">trunk/src/wp-includes/class-wp-http.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesFilephp">trunk/tests/phpunit/tests/admin/includesFile.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpSiteHealthphp">trunk/tests/phpunit/tests/admin/wpSiteHealth.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsdoEnclosephp">trunk/tests/phpunit/tests/functions/doEnclose.php</a></li>
<li><a href="#trunktestsphpunittestshttphttpphp">trunk/tests/phpunit/tests/http/http.php</a></li>
<li><a href="#trunktestsphpunittestshttpwpGetHttpHeadersphp">trunk/tests/phpunit/tests/http/wpGetHttpHeaders.php</a></li>
<li><a href="#trunktestsphpunittestshttpsdetectionphp">trunk/tests/phpunit/tests/https-detection.php</a></li>
<li><a href="#trunktestsphpunittestsoembedcontrollerphp">trunk/tests/phpunit/tests/oembed/controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestblockdirectorycontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpatterndirectorycontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpluginscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-plugins-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestschemasetupphp">trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiwpRestUrlDetailsControllerphp">trunk/tests/phpunit/tests/rest-api/wpRestUrlDetailsController.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswphttpphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-http.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-http.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/src/wp-includes/class-wp-http.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,7 +251,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param false|array|WP_Error $preempt A preemptive return value of an HTTP request. Default false.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param false|array|WP_Error $response A preemptive return value of an HTTP request. Default false.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $parsed_args HTTP request arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The request URL.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesFilephp"></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/admin/includesFile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesFile.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/admin/includesFile.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_http_request', array( $this, '_fake_download_url_non_200_response_code' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</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 _fake_download_url_non_200_response_code( $response, $args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function _fake_download_url_non_200_response_code( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> file_put_contents( $args['filename'], 'This is an unexpected error message from your favorite server.' );
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</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 filter_content_disposition_header_with_filename( $response, $args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_content_disposition_header_with_filename( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</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 filter_content_disposition_header_with_filename_with_path_traversal( $response, $args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_content_disposition_header_with_filename_with_path_traversal( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</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 filter_content_disposition_header_with_filename_without_quotes( $response, $args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_content_disposition_header_with_filename_without_quotes( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,7 +235,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</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 filter_content_disposition_header_with_filename_without_context( $response, $args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_content_disposition_header_with_filename_without_context( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,7 +253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</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 filter_content_disposition_header_with_filename_with_inline_context( $response, $args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_content_disposition_header_with_filename_with_inline_context( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,7 +271,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</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 filter_content_disposition_header_with_filename_with_form_data_context( $response, $args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_content_disposition_header_with_filename_with_form_data_context( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -365,12 +365,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Mock the HTTP request response.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $false False.
- * @param array $arguments Request arguments.
- * @param string $url Request URL.
- * @return array|bool
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param false|array|WP_Error $response A preemptive return value of an HTTP request. Default false.
+ * @param array $parsed_args HTTP request arguments.
+ * @param string $url The request URL.
+ * @return false|array|WP_Error Response data.
</ins><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 mock_http_request( $false, $arguments, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_http_request( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'https://example.com' === $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -379,6 +379,6 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpSiteHealthphp"></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/admin/wpSiteHealth.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpSiteHealth.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/admin/wpSiteHealth.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pre_http_request',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function ( $r, $parsed_args ) use ( &$responses, &$is_unauthorized, $good_basic_auth, $delay_the_response, $threshold ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function ( $response, $parsed_args ) use ( &$responses, &$is_unauthorized, $good_basic_auth, $delay_the_response, $threshold ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_response = array_shift( $responses );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsdoEnclosephp"></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/doEnclose.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/doEnclose.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/functions/doEnclose.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -254,12 +254,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $false False.
- * @param array $arguments Request arguments.
- * @param string $url Request URL.
- * @return array Header.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param false|array|WP_Error $response A preemptive return value of an HTTP request. Default false.
+ * @param array $parsed_args HTTP request arguments.
+ * @param string $url The request URL.
+ * @return array Response data.
</ins><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 mock_http_request( $false, $arguments, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_http_request( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Video and audio headers.
</span><span class="cx" style="display: block; padding: 0 10px"> $fake_headers = array(
</span></span></pre></div>
<a id="trunktestsphpunittestshttphttpphp"></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/http.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/http.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/http/http.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -584,7 +584,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter the response made by WP_HTTP::handle_redirects().
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pre_http_request',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function( $response, $args, $url ) use ( &$pre_http_request_filter_has_run ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function( $response, $parsed_args, $url ) use ( &$pre_http_request_filter_has_run ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $pre_http_request_filter_has_run = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Assert the redirect URL is correct.
</span></span></pre></div>
<a id="trunktestsphpunittestshttpwpGetHttpHeadersphp"></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/wpGetHttpHeaders.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/wpGetHttpHeaders.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/http/wpGetHttpHeaders.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,16 +44,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Mock the HTTP request response
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $false False.
- * @param array $arguments Request arguments.
- * @param string $url Request URL.
- * @return array|bool
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param false|array|WP_Error $response A preemptive return value of an HTTP request. Default false.
+ * @param array $parsed_args HTTP request arguments.
+ * @param string $url The request URL.
+ * @return false|array|WP_Error Response data.
</ins><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 mock_http_request( $false, $arguments, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_http_request( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'http://example.com' === $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return array( 'headers' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestshttpsdetectionphp"></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/https-detection.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/https-detection.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/https-detection.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,37 +264,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( wp_is_local_html_output( $html ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</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 record_request_url( $preempt, $parsed_args, $url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function record_request_url( $response, $parsed_args, $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->last_request_url = $url;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $preempt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</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 mock_success_with_sslverify( $preempt, $parsed_args ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_success_with_sslverify( $response, $parsed_args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $parsed_args['sslverify'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->mock_success();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $preempt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</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 mock_error_with_sslverify( $preempt, $parsed_args ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_error_with_sslverify( $response, $parsed_args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $parsed_args['sslverify'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->mock_error();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $preempt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</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 mock_success_without_sslverify( $preempt, $parsed_args ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_success_without_sslverify( $response, $parsed_args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $parsed_args['sslverify'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->mock_success();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $preempt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</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 mock_error_without_sslverify( $preempt, $parsed_args ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_error_without_sslverify( $response, $parsed_args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $parsed_args['sslverify'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->mock_error();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $preempt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><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"> public function mock_not_found() {
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedcontrollerphp"></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/controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/controller.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/oembed/controller.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,13 +84,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Intercept oEmbed requests and mock responses.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param mixed $preempt Whether to preempt an HTTP request's return value. Default false.
- * @param mixed $r HTTP request arguments.
- * @param string $url The request URL.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param false|array|WP_Error $response A preemptive return value of an HTTP request. Default false.
+ * @param array $parsed_args HTTP request arguments.
+ * @param string $url The request URL.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array Response data.
</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 mock_embed_request( $preempt, $r, $url ) {
- unset( $preempt, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_embed_request( $response, $parsed_args, $url ) {
+ unset( $response, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed_url = wp_parse_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> $query = isset( $parsed_url['query'] ) ? $parsed_url['query'] : '';
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestblockdirectorycontrollerphp"></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/rest-api/rest-block-directory-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,13 +274,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> private function prevent_requests_to_host( $blocked_host = 'api.wordpress.org' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pre_http_request',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static function ( $return, $args, $url ) use ( $blocked_host ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static function ( $response, $parsed_args, $url ) use ( $blocked_host ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( @parse_url( $url, PHP_URL_HOST ) === $blocked_host ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'plugins_api_failed', "An expected error occurred connecting to $blocked_host because of a unit test", "cURL error 7: Failed to connect to $blocked_host port 80: Connection refused" );
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> 10,
</span><span class="cx" style="display: block; padding: 0 10px"> 3
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpatterndirectorycontrollerphp"></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/rest-api/rest-pattern-directory-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -522,10 +522,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> private static function mock_successful_response( $action, $expects_results ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pre_http_request',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static function ( $preempt, $args, $url ) use ( $action, $expects_results ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static function ( $response, $parsed_args, $url ) use ( $action, $expects_results ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'api.wordpress.org' !== wp_parse_url( $url, PHP_URL_HOST ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $preempt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><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"> $response = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -556,7 +556,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> private static function prevent_requests_to_host( $blocked_host = 'api.wordpress.org' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pre_http_request',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static function ( $return, $args, $url ) use ( $blocked_host ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static function ( $response, $parsed_args, $url ) use ( $blocked_host ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wp_parse_url( $url, PHP_URL_HOST ) === $blocked_host ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -567,7 +567,7 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> 10,
</span><span class="cx" style="display: block; padding: 0 10px"> 3
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpluginscontrollerphp"></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/rest-api/rest-plugins-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-plugins-controller.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/rest-api/rest-plugins-controller.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1139,13 +1139,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> private function prevent_requests_to_host( $blocked_host = 'api.wordpress.org' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pre_http_request',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static function ( $return, $args, $url ) use ( $blocked_host ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static function ( $response, $parsed_args, $url ) use ( $blocked_host ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( @parse_url( $url, PHP_URL_HOST ) === $blocked_host ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'plugins_api_failed', "An expected error occurred connecting to $blocked_host because of a unit test", "cURL error 7: Failed to connect to $blocked_host port 80: Connection refused" );
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $response;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> 10,
</span><span class="cx" style="display: block; padding: 0 10px"> 3
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestschemasetupphp"></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/rest-api/rest-schema-setup.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,8 +34,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tear_down();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</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 mock_embed_request( $preempt, $r, $url ) {
- unset( $preempt, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_embed_request( $response, $parsed_args, $url ) {
+ unset( $response, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Mock request to YouTube Embed.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false !== strpos( $url, self::YOUTUBE_VIDEO_ID ) ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiwpRestUrlDetailsControllerphp"></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/rest-api/wpRestUrlDetailsController.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/wpRestUrlDetailsController.php 2023-01-04 14:16:57 UTC (rev 55028)
+++ trunk/tests/phpunit/tests/rest-api/wpRestUrlDetailsController.php 2023-01-05 10:21:19 UTC (rev 55029)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1096,20 +1096,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array faux/mocked response.
</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 mock_success_request_to_remote_url( $response, $args ) {
- return $this->mock_request_to_remote_url( 'success', $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_success_request_to_remote_url( $response, $parsed_args ) {
+ return $this->mock_request_to_remote_url( 'success', $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</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 mock_failed_request_to_remote_url( $response, $args ) {
- return $this->mock_request_to_remote_url( 'failure', $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_failed_request_to_remote_url( $response, $parsed_args ) {
+ return $this->mock_request_to_remote_url( 'failure', $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</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 mock_request_to_remote_url_with_empty_body_response( $response, $args ) {
- return $this->mock_request_to_remote_url( 'empty_body', $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mock_request_to_remote_url_with_empty_body_response( $response, $parsed_args ) {
+ return $this->mock_request_to_remote_url( 'empty_body', $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- private function mock_request_to_remote_url( $result_type, $args ) {
- $this->request_args = $args;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function mock_request_to_remote_url( $result_type, $parsed_args ) {
+ $this->request_args = $parsed_args;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $types = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'success',
</span></span></pre>
</div>
</div>
</body>
</html>