Tests: Rename classes in phpunit/tests/comment/ per the naming conventions.

https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489], [53863].

See #56793.

git-svn-id: https://develop.svn.wordpress.org/trunk@54704 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2022-10-27 15:53:08 +00:00
parent 7691fe2725
commit 5b344d17da
11 changed files with 26 additions and 30 deletions

View File

@ -3,7 +3,7 @@
/**
* @group comment
*
*@covers ::get_comment_author_url
* @covers ::get_comment_author_url
*/
class Tests_Comment_GetCommentAuthorUrl extends WP_UnitTestCase {
public function get_comment_author_url_filter( $url, $id, $comment ) {

View File

@ -3,11 +3,9 @@
/**
* @group comment
*
* Class Tests_Get_Comment_Count
*
* @covers ::get_comment_count
*/
class Tests_Get_Comment_Count extends WP_UnitTestCase {
class Tests_Comment_GetCommentCount extends WP_UnitTestCase {
public function test_get_comment_count() {
$count = get_comment_count();

View File

@ -3,11 +3,9 @@
/**
* @group comment
*
* Class Tests_Get_Comment_Excerpt
*
* @covers ::get_comment_excerpt
*/
class Tests_Get_Comment_Excerpt extends WP_UnitTestCase {
class Tests_Comment_GetCommentExcerpt extends WP_UnitTestCase {
protected static $bacon_comment = 'Bacon ipsum dolor amet porchetta capicola sirloin prosciutto brisket shankle jerky. Ham hock filet mignon boudin ground round, prosciutto alcatra spare ribs meatball turducken pork beef ribs ham beef. Bacon pastrami short loin, venison tri-tip ham short ribs doner swine. Tenderloin pig tongue pork jowl doner. Pork loin rump t-bone, beef strip steak flank drumstick tri-tip short loin capicola jowl. Cow filet mignon hamburger doner rump. Short loin jowl drumstick, tongue tail beef ribs pancetta flank brisket landjaeger chuck venison frankfurter turkey.
Brisket shank rump, tongue beef ribs swine fatback turducken capicola meatball picanha chicken cupim meatloaf turkey. Bacon biltong shoulder tail frankfurter boudin cupim turkey drumstick. Porchetta pig shoulder, jerky flank pork tail meatball hamburger. Doner ham hock ribeye tail jerky swine. Leberkas ribeye pancetta, tenderloin capicola doner turducken chicken venison ground round boudin pork chop. Tail pork loin pig spare ribs, biltong ribeye brisket pork chop cupim. Short loin leberkas spare ribs jowl landjaeger tongue kevin flank bacon prosciutto.

View File

@ -6,7 +6,7 @@
*
* @covers ::get_lastcommentmodified
*/
class Tests_Comment_Last_Modified extends WP_UnitTestCase {
class Tests_Comment_GetLastCommentModified extends WP_UnitTestCase {
public function test_no_comments() {
$this->assertFalse( get_lastcommentmodified() );
}

View File

@ -2,7 +2,7 @@
/**
* @group comment
*/
class Tests_Comment_Meta_Cache extends WP_UnitTestCase {
class Tests_Comment_MetaCache extends WP_UnitTestCase {
protected $i = 0;
protected $queries = 0;

View File

@ -2080,11 +2080,11 @@ class Tests_Comment_Query extends WP_UnitTestCase {
$this->assertSameSets( array( $c3 ), $comment_ids );
}
/**
* @ticket 29885
*
* @covers ::get_comments
*/
/**
* @ticket 29885
*
* @covers ::get_comments
*/
public function test_fields_author__in() {
$p1 = self::factory()->post->create();
$p2 = self::factory()->post->create();
@ -2130,11 +2130,11 @@ class Tests_Comment_Query extends WP_UnitTestCase {
$this->assertSameSets( array( $c1, $c3 ), $comment_ids );
}
/**
* @ticket 29885
*
* @covers ::get_comments
*/
/**
* @ticket 29885
*
* @covers ::get_comments
*/
public function test_fields_author__not_in() {
$p1 = self::factory()->post->create();
$p2 = self::factory()->post->create();
@ -3328,7 +3328,6 @@ class Tests_Comment_Query extends WP_UnitTestCase {
}
/**
*
* @covers WP_Comment_Query::query
*/
public function test_post_name_single_value() {

View File

@ -5,7 +5,7 @@
*
* @covers ::_wp_batch_update_comment_type
*/
class Tests_Batch_Update_Comment_Type extends WP_UnitTestCase {
class Tests_Comment_wpBatchUpdateCommentType extends WP_UnitTestCase {
/**
* @ticket 49236

View File

@ -2,8 +2,10 @@
/**
* @group comment
*
* @covers ::wp_check_comment_disallowed_list
*/
class Tests_WP_Blocklist_Check extends WP_UnitTestCase {
class Tests_Comment_wpCheckCommentDisallowedList extends WP_UnitTestCase {
public function test_should_return_true_when_content_matches_disallowed_keys() {
$author = 'Sting';

View File

@ -5,7 +5,7 @@
*
* @covers WP_Comment::get_instance
*/
class Tests_Term_WpComment extends WP_UnitTestCase {
class Tests_Comment_WpComment extends WP_UnitTestCase {
protected static $comment_id;
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {

View File

@ -3,11 +3,9 @@
/**
* @group comment
*
* Class Tests_WP_Count_Comments
*
* @covers ::wp_count_comments
*/
class Tests_WP_Count_Comments extends WP_UnitTestCase {
class Tests_Comment_wpCountComments extends WP_UnitTestCase {
public function test_wp_count_comments() {
$count = wp_count_comments();

View File

@ -5,10 +5,7 @@
*
* @covers ::wp_update_comment_count_now
*/
class Tests_Update_Comment_Count_Now extends WP_UnitTestCase {
public function _return_100() {
return 100;
}
class Tests_Comment_wpUpdateCommentCountNow extends WP_UnitTestCase {
public function test_invalid_post_bails_early() {
$this->assertFalse( wp_update_comment_count_now( 100 ) );
@ -50,4 +47,8 @@ class Tests_Update_Comment_Count_Now extends WP_UnitTestCase {
remove_filter( 'pre_wp_update_comment_count_now', array( $this, '_return_100' ) );
}
public function _return_100() {
return 100;
}
}