From 5a3f8484d611c3978739a7fcb961938681528352 Mon Sep 17 00:00:00 2001
From: Andrew Ozz
is changed to
elsewhere. Left in because
- // that replacement shouldn't happen (what if you want
- // HTML 4 output?).
+
+ /**
+ * I don't think this can ever happen in production;
+ *
is changed to
elsewhere. Left in because
+ * that replacement shouldn't happen (what if you want
+ * HTML 4 output?).
+ */
public function test_removes_html_br() {
$source = 'a b c\n
sldfj
';
$res = 'a b c\nsldfj';
diff --git a/tests/phpunit/tests/formatting/convertInvalidEntries.php b/tests/phpunit/tests/formatting/convertInvalidEntries.php
index 9b243ee421..6101165191 100644
--- a/tests/phpunit/tests/formatting/convertInvalidEntries.php
+++ b/tests/phpunit/tests/formatting/convertInvalidEntries.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::convert_invalid_entities
*/
class Tests_Formatting_ConvertInvalidEntities extends WP_UnitTestCase {
public function test_replaces_windows1252_entities_with_unicode_ones() {
@@ -19,6 +21,9 @@ class Tests_Formatting_ConvertInvalidEntities extends WP_UnitTestCase {
$this->assertSame( $output, convert_invalid_entities( $input ) );
}
+ /**
+ * @covers ::convert_chars
+ */
public function test_escapes_lone_ampersands() {
$this->assertSame( 'at&t', convert_chars( 'at&t' ) );
}
diff --git a/tests/phpunit/tests/formatting/convertSmilies.php b/tests/phpunit/tests/formatting/convertSmilies.php
index 760625e40a..ce17bbf177 100644
--- a/tests/phpunit/tests/formatting/convertSmilies.php
+++ b/tests/phpunit/tests/formatting/convertSmilies.php
@@ -3,6 +3,8 @@
/**
* @group formatting
* @group emoji
+ *
+ * @covers ::convert_smilies
*/
class Tests_Formatting_ConvertSmilies extends WP_UnitTestCase {
diff --git a/tests/phpunit/tests/formatting/date.php b/tests/phpunit/tests/formatting/date.php
index 9f0f975d4c..32e68d8f1a 100644
--- a/tests/phpunit/tests/formatting/date.php
+++ b/tests/phpunit/tests/formatting/date.php
@@ -10,6 +10,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
* Unpatched, this test passes only when Europe/London is not observing DST.
*
* @ticket 20328
+ *
+ * @covers ::get_date_from_gmt
*/
public function test_get_date_from_gmt_outside_of_dst() {
update_option( 'timezone_string', 'Europe/London' );
@@ -22,6 +24,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
* Unpatched, this test passes only when Europe/London is observing DST.
*
* @ticket 20328
+ *
+ * @covers ::get_date_from_gmt
*/
public function test_get_date_from_gmt_during_dst() {
update_option( 'timezone_string', 'Europe/London' );
@@ -32,6 +36,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
/**
* @ticket 20328
+ *
+ * @covers ::get_gmt_from_date
*/
public function test_get_gmt_from_date_outside_of_dst() {
update_option( 'timezone_string', 'Europe/London' );
@@ -42,6 +48,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
/**
* @ticket 20328
+ *
+ * @covers ::get_gmt_from_date
*/
public function test_get_gmt_from_date_during_dst() {
update_option( 'timezone_string', 'Europe/London' );
@@ -52,6 +60,9 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
/**
* @ticket 34279
+ *
+ * @covers ::get_date_from_gmt
+ *
*/
public function test_get_date_and_time_from_gmt_no_timezone() {
$local = '2012-01-01 12:34:56';
@@ -61,6 +72,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
/**
* @ticket 34279
+ *
+ * @covers ::get_gmt_from_date
*/
public function test_get_gmt_from_date_no_timezone() {
$gmt = '2012-12-01 00:00:00';
@@ -70,6 +83,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
/**
* @ticket 34279
+ *
+ * @covers ::get_gmt_from_date
*/
public function test_get_gmt_from_date_short_date() {
update_option( 'timezone_string', 'Europe/London' );
@@ -80,6 +95,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
/**
* @ticket 34279
+ *
+ * @covers ::get_gmt_from_date
*/
public function test_get_gmt_from_date_string_date() {
update_option( 'timezone_string', 'Europe/London' );
@@ -90,6 +107,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
/**
* @ticket 34279
+ *
+ * @covers ::get_gmt_from_date
*/
public function test_get_gmt_from_date_string_date_no_timezone() {
$local = 'now';
@@ -101,6 +120,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
* @ticket 31809
*
* @dataProvider timezone_provider
+ *
+ * @covers ::get_gmt_from_date
*/
public function test_gmt_from_date_correct_time( $timezone_string, $gmt_offset ) {
update_option( 'timezone_string', $timezone_string );
@@ -117,6 +138,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
* @ticket 31809
*
* @dataProvider timezone_provider
+ *
+ * @covers ::get_date_from_gmt
*/
public function test_date_from_gmt_correct_time( $timezone_string, $gmt_offset ) {
update_option( 'timezone_string', $timezone_string );
@@ -133,6 +156,8 @@ class Tests_Formatting_Date extends WP_UnitTestCase {
* @ticket 31809
*
* @dataProvider timezone_provider
+ *
+ * @covers ::iso8601_to_datetime
*/
public function test_is8601_to_datetime_correct_time( $timezone_string, $gmt_offset ) {
update_option( 'timezone_string', $timezone_string );
diff --git a/tests/phpunit/tests/formatting/emoji.php b/tests/phpunit/tests/formatting/emoji.php
index d3fb98e82e..cff36ccb8a 100644
--- a/tests/phpunit/tests/formatting/emoji.php
+++ b/tests/phpunit/tests/formatting/emoji.php
@@ -11,6 +11,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
/**
* @ticket 36525
+ *
+ * @covers ::_print_emoji_detection_script
*/
public function test_unfiltered_emoji_cdns() {
// `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present:
@@ -27,6 +29,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
/**
* @ticket 36525
+ *
+ * @covers ::_print_emoji_detection_script
*/
public function test_filtered_emoji_svn_cdn() {
$filtered_svn_cdn = $this->_filtered_emoji_svn_cdn();
@@ -50,6 +54,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
/**
* @ticket 36525
+ *
+ * @covers ::_print_emoji_detection_script
*/
public function test_filtered_emoji_png_cdn() {
$filtered_png_cdn = $this->_filtered_emoji_png_cdn();
@@ -69,6 +75,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
/**
* @ticket 41501
+ *
+ * @covers ::_wp_emoji_list
*/
public function test_wp_emoji_list_returns_data() {
$default = _wp_emoji_list();
@@ -113,6 +121,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
/**
* @ticket 35293
* @dataProvider data_wp_encode_emoji
+ *
+ * @covers ::wp_encode_emoji
*/
public function test_wp_encode_emoji( $emoji, $expected ) {
$this->assertSame( $expected, wp_encode_emoji( $emoji ) );
@@ -148,6 +158,8 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
/**
* @ticket 35293
* @dataProvider data_wp_staticize_emoji
+ *
+ * @covers ::wp_staticize_emoji
*/
public function test_wp_staticize_emoji( $emoji, $expected ) {
$this->assertSame( $expected, wp_staticize_emoji( $emoji ) );
diff --git a/tests/phpunit/tests/formatting/ent2ncr.php b/tests/phpunit/tests/formatting/ent2ncr.php
index f5859974ef..daf7f44b4d 100644
--- a/tests/phpunit/tests/formatting/ent2ncr.php
+++ b/tests/phpunit/tests/formatting/ent2ncr.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::ent2ncr
*/
class Tests_Formatting_Ent2ncr extends WP_UnitTestCase {
/**
diff --git a/tests/phpunit/tests/formatting/escAttr.php b/tests/phpunit/tests/formatting/escAttr.php
index e60c5e9552..879b86ed05 100644
--- a/tests/phpunit/tests/formatting/escAttr.php
+++ b/tests/phpunit/tests/formatting/escAttr.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::esc_attr
*/
class Tests_Formatting_EscAttr extends WP_UnitTestCase {
public function test_esc_attr_quotes() {
diff --git a/tests/phpunit/tests/formatting/escHtml.php b/tests/phpunit/tests/formatting/escHtml.php
index 3c6b918cfc..bcd21043d7 100644
--- a/tests/phpunit/tests/formatting/escHtml.php
+++ b/tests/phpunit/tests/formatting/escHtml.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::esc_html
*/
class Tests_Formatting_EscHtml extends WP_UnitTestCase {
public function test_esc_html_basics() {
diff --git a/tests/phpunit/tests/formatting/escJs.php b/tests/phpunit/tests/formatting/escJs.php
index ddb5420174..0f4365d1b3 100644
--- a/tests/phpunit/tests/formatting/escJs.php
+++ b/tests/phpunit/tests/formatting/escJs.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::esc_js
*/
class Tests_Formatting_EscJs extends WP_UnitTestCase {
public function test_js_escape_simple() {
diff --git a/tests/phpunit/tests/formatting/escTextarea.php b/tests/phpunit/tests/formatting/escTextarea.php
index 8582216ec8..f53f5bd313 100644
--- a/tests/phpunit/tests/formatting/escTextarea.php
+++ b/tests/phpunit/tests/formatting/escTextarea.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::esc_textarea
*/
class Tests_Formatting_EscTextarea extends WP_UnitTestCase {
diff --git a/tests/phpunit/tests/formatting/escUrl.php b/tests/phpunit/tests/formatting/escUrl.php
index 678fc50100..d81ac9a95c 100644
--- a/tests/phpunit/tests/formatting/escUrl.php
+++ b/tests/phpunit/tests/formatting/escUrl.php
@@ -7,6 +7,8 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
/**
* @ticket 23605
+ *
+ * @covers ::esc_url
*/
public function test_spaces() {
$this->assertSame( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr WordPress' ) );
@@ -19,6 +21,9 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
$this->assertSame( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one%20two%20three&bar=four' ) );
}
+ /**
+ * @covers ::esc_url
+ */
public function test_bad_characters() {
$this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0Ago' ) );
$this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0ago' ) );
@@ -33,6 +38,9 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
$this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADa' ) );
}
+ /**
+ * @covers ::esc_url
+ */
public function test_relative() {
$this->assertSame( '/example.php', esc_url( '/example.php' ) );
$this->assertSame( 'example.php', esc_url( 'example.php' ) );
@@ -40,6 +48,10 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
$this->assertSame( '?foo=bar', esc_url( '?foo=bar' ) );
}
+ /**
+ * @covers ::esc_url
+ * @covers ::esc_url_raw
+ */
public function test_all_url_parts() {
$url = 'https://user:pass@host.example.com:1234/path;p=1?query=2&r[]=3#fragment';
@@ -56,10 +68,13 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
),
parse_url( $url )
);
- $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', sanitize_url( $url ) );
+ $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url_raw( $url ) );
$this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url( $url ) );
}
+ /**
+ * @covers ::esc_url
+ */
public function test_bare() {
$this->assertSame( 'http://example.com?foo', esc_url( 'example.com?foo' ) );
$this->assertSame( 'http://example.com', esc_url( 'example.com' ) );
@@ -68,10 +83,14 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
$this->assertSame( 'http://баба.org/баба', esc_url( 'баба.org/баба' ) );
}
+ /**
+ * @covers ::esc_url
+ * @covers ::esc_url_raw
+ */
public function test_encoding() {
- $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) );
- $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) );
- $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) );
+ $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
+ $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
+ $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
$this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
$this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
@@ -81,6 +100,10 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
$this->assertSame( "http://example.com?url={$param}", esc_url( "http://example.com?url={$param}" ) );
}
+ /**
+ * @covers ::esc_url
+ * @covers ::wp_allowed_protocols
+ */
public function test_protocol() {
$this->assertSame( 'http://example.com', esc_url( 'http://example.com' ) );
$this->assertSame( '', esc_url( 'nasty://example.com/' ) );
@@ -145,23 +168,34 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
/**
* @ticket 23187
+ *
+ * @covers ::esc_url
*/
public function test_protocol_case() {
$this->assertSame( 'http://example.com', esc_url( 'HTTP://example.com' ) );
$this->assertSame( 'http://example.com', esc_url( 'Http://example.com' ) );
}
+ /**
+ * @covers ::esc_url
+ */
public function test_display_extras() {
$this->assertSame( 'http://example.com/'quoted'', esc_url( 'http://example.com/\'quoted\'' ) );
$this->assertSame( 'http://example.com/\'quoted\'', esc_url( 'http://example.com/\'quoted\'', null, 'notdisplay' ) );
}
+ /**
+ * @covers ::esc_url
+ */
public function test_non_ascii() {
$this->assertSame( 'http://example.org/баба', esc_url( 'http://example.org/баба' ) );
$this->assertSame( 'http://баба.org/баба', esc_url( 'http://баба.org/баба' ) );
$this->assertSame( 'http://müller.com/', esc_url( 'http://müller.com/' ) );
}
+ /**
+ * @covers ::esc_url
+ */
public function test_feed() {
$this->assertSame( '', esc_url( 'feed:javascript:alert(1)' ) );
$this->assertSame( '', esc_url( 'feed:javascript:feed:alert(1)' ) );
@@ -172,6 +206,8 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
/**
* @ticket 16859
+ *
+ * @covers ::esc_url
*/
public function test_square_brackets() {
$this->assertSame( '/example.php?one%5B%5D=two', esc_url( '/example.php?one[]=two' ) );
@@ -187,14 +223,18 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
/**
* Courtesy of http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding
+ *
+ * @covers ::esc_url_raw
*/
public function test_reserved_characters() {
$url = "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$%27()*+,;=/?:@-._~!$%27()*+,;==#/?:@-._~!$&'()*+,;=";
- $this->assertSame( $url, sanitize_url( $url ) );
+ $this->assertSame( $url, esc_url_raw( $url ) );
}
/**
* @ticket 21974
+ *
+ * @covers ::esc_url
*/
public function test_protocol_relative_with_colon() {
$this->assertSame( '//example.com/foo?foo=abc:def', esc_url( '//example.com/foo?foo=abc:def' ) );
@@ -202,6 +242,8 @@ class Tests_Formatting_EscUrl extends WP_UnitTestCase {
/**
* @ticket 31632
+ *
+ * @covers ::esc_url
*/
public function test_mailto_with_newline() {
$body = <<
/**
* wpautop() should not add extra

---&', wptexturize( '
---&' ) ); $this->assertSame( '
--&', wptexturize( '--&' ) );
@@ -34,6 +41,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 1418
+ *
+ * @covers ::wptexturize
*/
public function test_bracketed_quotes_1418() {
$this->assertSame( '(“test”)', wptexturize( '("test")' ) );
@@ -43,6 +52,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 3810
+ *
+ * @covers ::wptexturize
*/
public function test_bracketed_quotes_3810() {
$this->assertSame( 'A dog (“Hubertus”) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) );
@@ -50,6 +61,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 4539
+ *
+ * @covers ::wptexturize
*/
public function test_basic_quotes() {
$this->assertSame( 'test’s', wptexturize( 'test\'s' ) );
@@ -73,6 +86,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 4539
* @ticket 15241
+ *
+ * @covers ::wptexturize
*/
public function test_full_sentences_with_unmatched_single_quotes() {
$this->assertSame(
@@ -83,6 +98,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 4539
+ *
+ * @covers ::wptexturize
*/
public function test_quotes() {
$this->assertSame( '“Quoted String”', wptexturize( '"Quoted String"' ) );
@@ -102,6 +119,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 4539
+ *
+ * @covers ::wptexturize
*/
public function test_quotes_before_s() {
$this->assertSame( 'test’s', wptexturize( "test's" ) );
@@ -113,6 +132,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 4539
+ *
+ * @covers ::wptexturize
*/
public function test_quotes_before_numbers() {
$this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) );
@@ -141,6 +162,9 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
$this->assertSame( '}”Class of ’99″{', wptexturize( "}\"Class of '99\"{" ) );
}
+ /**
+ * @covers ::wptexturize
+ */
public function test_quotes_after_numbers() {
$this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) );
}
@@ -148,6 +172,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 4539
* @ticket 15241
+ *
+ * @covers ::wptexturize
*/
public function test_other_html() {
$this->assertSame( '‘', wptexturize( "'" ) );
@@ -155,10 +181,16 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
// $this->assertSame( '“Quoted Text”,', wptexturize( '"Quoted Text",' ) );
}
+ /**
+ * @covers ::wptexturize
+ */
public function test_x() {
$this->assertSame( '14×24', wptexturize( '14x24' ) );
}
+ /**
+ * @covers ::wptexturize
+ */
public function test_minutes_seconds() {
$this->assertSame( '9′', wptexturize( '9\'' ) );
$this->assertSame( '9″', wptexturize( '9"' ) );
@@ -172,6 +204,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 8775
+ *
+ * @covers ::wptexturize
*/
public function test_wptexturize_quotes_around_numbers() {
$this->assertSame( '“12345”', wptexturize( '"12345"' ) );
@@ -182,6 +216,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 8912
+ *
+ * @covers ::wptexturize
*/
public function test_wptexturize_html_comments() {
$this->assertSame( '', wptexturize( '' ) );
@@ -192,6 +228,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 4539
* @ticket 15241
+ *
+ * @covers ::wptexturize
*/
public function test_entity_quote_cuddling() {
$this->assertSame( ' “Testing”', wptexturize( ' "Testing"' ) );
@@ -200,6 +238,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 22823
+ *
+ * @covers ::wptexturize
*/
public function test_apostrophes_before_primes() {
$this->assertSame( 'WordPress 3.5’s release date', wptexturize( "WordPress 3.5's release date" ) );
@@ -207,6 +247,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 23185
+ *
+ * @covers ::wptexturize
*/
public function test_spaces_around_hyphens() {
$nbsp = "\xC2\xA0";
@@ -230,6 +272,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
/**
* @ticket 31030
+ *
+ * @covers ::wptexturize
*/
public function test_hyphens_at_start_and_end() {
$this->assertSame( '– ', wptexturize( '- ' ) );
@@ -247,6 +291,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
* These should never happen, even if the desired output changes some day.
*
* @ticket 22692
+ *
+ * @covers ::wptexturize
*/
public function test_spaces_around_quotes_never() {
$nbsp = "\xC2\xA0";
@@ -264,9 +310,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_spaces_around_quotes
+ *
+ * @covers ::wptexturize
*/
public function test_spaces_around_quotes( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_spaces_around_quotes() {
@@ -320,9 +368,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_apos_before_digits
+ *
+ * @covers ::wptexturize
*/
public function test_apos_before_digits( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_apos_before_digits() {
@@ -361,9 +411,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_opening_single_quote
+ *
+ * @covers ::wptexturize
*/
public function test_opening_single_quote( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_opening_single_quote() {
@@ -490,9 +542,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_double_prime
+ *
+ * @covers ::wptexturize
*/
public function test_double_prime( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_double_prime() {
@@ -523,9 +577,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_single_prime
+ *
+ * @covers ::wptexturize
*/
public function test_single_prime( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_single_prime() {
@@ -556,9 +612,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_contractions
+ *
+ * @covers ::wptexturize
*/
public function test_contractions( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_contractions() {
@@ -597,9 +655,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_opening_quote
+ *
+ * @covers ::wptexturize
*/
public function test_opening_quote( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_opening_quote() {
@@ -674,9 +734,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_closing_quote
+ *
+ * @covers ::wptexturize
*/
public function test_closing_quote( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_closing_quote() {
@@ -763,9 +825,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_closing_single_quote
+ *
+ * @covers ::wptexturize
*/
public function test_closing_single_quote( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_closing_single_quote() {
@@ -853,9 +917,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
* @ticket 22692
* @ticket 30445
* @dataProvider data_multiplication
+ *
+ * @covers ::wptexturize
*/
public function test_multiplication( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_multiplication() {
@@ -903,9 +969,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_ampersand
+ *
+ * @covers ::wptexturize
*/
public function test_ampersand( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_ampersand() {
@@ -968,9 +1036,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_cockney
+ *
+ * @covers ::wptexturize
*/
public function test_cockney( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_cockney() {
@@ -1029,9 +1099,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_smart_dashes
+ *
+ * @covers ::wptexturize
*/
public function test_smart_dashes( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_smart_dashes() {
@@ -1082,9 +1154,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 22692
* @dataProvider data_misc_static_replacements
+ *
+ * @covers ::wptexturize
*/
public function test_misc_static_replacements( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_misc_static_replacements() {
@@ -1137,9 +1211,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 8775
* @dataProvider data_quoted_numbers
+ *
+ * @covers ::wptexturize
*/
public function test_quoted_numbers( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_quoted_numbers() {
@@ -1188,9 +1264,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 20342
* @dataProvider data_quotes_and_dashes
+ *
+ * @covers ::wptexturize
*/
public function test_quotes_and_dashes( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_quotes_and_dashes() {
@@ -1251,9 +1329,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 12690
* @dataProvider data_tag_avoidance
+ *
+ * @covers ::wptexturize
*/
public function test_tag_avoidance( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_tag_avoidance() {
@@ -1474,9 +1554,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 26850
* @dataProvider data_year_abbr
+ *
+ * @covers ::wptexturize
*/
public function test_year_abbr( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_year_abbr() {
@@ -1563,6 +1645,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 27426
* @dataProvider data_translate
+ *
+ * @covers ::wptexturize
*/
public function test_translate( $input, $output ) {
add_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 );
@@ -1572,7 +1656,7 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
remove_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 );
wptexturize( 'reset', true );
- return $this->assertSame( $output, $result );
+ $this->assertSame( $output, $result );
}
public function filter_translate( $translations, $text, $context, $domain ) {
@@ -1790,9 +1874,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 28483
* @dataProvider data_element_stack
+ *
+ * @covers ::wptexturize
*/
public function test_element_stack( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_element_stack() {
@@ -1841,6 +1927,8 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 29557
* @dataProvider data_unregistered_shortcodes
+ *
+ * @covers ::wptexturize
*/
public function test_unregistered_shortcodes( $input, $output ) {
add_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 );
@@ -1926,9 +2014,11 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
*
* @ticket 29256
* @dataProvider data_primes_vs_quotes
+ *
+ * @covers ::wptexturize
*/
public function test_primes_vs_quotes( $input, $output ) {
- return $this->assertSame( $output, wptexturize( $input ) );
+ $this->assertSame( $output, wptexturize( $input ) );
}
public function data_primes_vs_quotes() {
@@ -1988,6 +2078,8 @@ String with a number followed by a single quote ‘Expendables 3’ vest
*
* @ticket 29256
* @dataProvider data_primes_quotes_translation
+ *
+ * @covers ::wptexturize
*/
public function test_primes_quotes_translation( $input, $output ) {
add_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 );
@@ -1997,7 +2089,7 @@ String with a number followed by a single quote ‘Expendables 3’ vest
remove_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 );
wptexturize( 'reset', true );
- return $this->assertSame( $output, $result );
+ $this->assertSame( $output, $result );
}
public function filter_translate2( $translations, $text, $context, $domain ) {
@@ -2081,6 +2173,8 @@ String with a number followed by a single quote !q1!Expendables 3!q1! vestibulum
* Automated performance testing of the main regex.
*
* @dataProvider data_whole_posts
+ *
+ * @covers ::preg_split
*/
public function test_pcre_performance( $input ) {
global $shortcode_tags;
@@ -2101,6 +2195,8 @@ String with a number followed by a single quote !q1!Expendables 3!q1! vestibulum
* Ensure that a trailing less-than symbol doesn't cause a PHP warning.
*
* @ticket 35864
+ *
+ * @covers ::wptexturize
*/
public function test_trailing_less_than() {
$this->assertSame( 'F–oo<', wptexturize( 'F--oo<', true ) );
diff --git a/tests/phpunit/tests/formatting/wpTrimExcerpt.php b/tests/phpunit/tests/formatting/wpTrimExcerpt.php
index ed5117bb56..c3ab336bf9 100644
--- a/tests/phpunit/tests/formatting/wpTrimExcerpt.php
+++ b/tests/phpunit/tests/formatting/wpTrimExcerpt.php
@@ -2,6 +2,7 @@
/**
* @group formatting
+ *
* @covers ::wp_trim_excerpt
*/
class Tests_Formatting_wpTrimExcerpt extends WP_UnitTestCase {
diff --git a/tests/phpunit/tests/formatting/wpTrimWords.php b/tests/phpunit/tests/formatting/wpTrimWords.php
index 1becf2b5d2..b918fd1642 100644
--- a/tests/phpunit/tests/formatting/wpTrimWords.php
+++ b/tests/phpunit/tests/formatting/wpTrimWords.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::wp_trim_words
*/
class Tests_Formatting_wpTrimWords extends WP_UnitTestCase {
diff --git a/tests/phpunit/tests/formatting/zeroise.php b/tests/phpunit/tests/formatting/zeroise.php
index c702fc4eb9..fb8f49897b 100644
--- a/tests/phpunit/tests/formatting/zeroise.php
+++ b/tests/phpunit/tests/formatting/zeroise.php
@@ -2,6 +2,8 @@
/**
* @group formatting
+ *
+ * @covers ::zeroise
*/
class Tests_Formatting_Zeroise extends WP_UnitTestCase {
public function test_pads_with_leading_zeroes() {