From 3e606ecd3ff61cd72baeebc4d031665988b3cfde Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 31 Oct 2017 09:13:09 +0000 Subject: [PATCH] Build/Test Tools: Pass correct `$message` argument to `WP_UnitTestCase::setExpectedException()` in `Tests_Ajax_CompressionTest::test_logged_out()` and `Tests_Ajax_TagSearch::test_no_results()`. PHPUnit 6.4.1 and earlier versions ignored the `'0'` value, causing the issue to go unnoticed. Merge of [41870] to the 4.4 branch. Props SergeyBiryukov. Fixes #42232. git-svn-id: https://develop.svn.wordpress.org/branches/4.4@42055 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/ajax/Compression.php | 2 +- tests/phpunit/tests/ajax/TagSearch.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/ajax/Compression.php b/tests/phpunit/tests/ajax/Compression.php index d82e0c54b9..e0ab837c07 100644 --- a/tests/phpunit/tests/ajax/Compression.php +++ b/tests/phpunit/tests/ajax/Compression.php @@ -25,7 +25,7 @@ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { $_GET['test'] = 1; // Make the request - $this->setExpectedException( 'WPAjaxDieStopException', '0' ); + $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); $this->_handleAjax( 'wp-compression-test' ); } diff --git a/tests/phpunit/tests/ajax/TagSearch.php b/tests/phpunit/tests/ajax/TagSearch.php index 75a3af8c27..78f32ec8a4 100644 --- a/tests/phpunit/tests/ajax/TagSearch.php +++ b/tests/phpunit/tests/ajax/TagSearch.php @@ -74,7 +74,7 @@ class Tests_Ajax_TagSearch extends WP_Ajax_UnitTestCase { // Make the request // No output, so we get a stop exception - $this->setExpectedException( 'WPAjaxDieStopException', '0' ); + $this->setExpectedException( 'WPAjaxDieStopException', '' ); $this->_handleAjax( 'ajax-tag-search' ); }