Code is Poetry.

WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2017-11-30 23:09:33 +00:00
parent ec6a089f98
commit 8f95800d52
1103 changed files with 105981 additions and 78187 deletions

View File

@@ -10,15 +10,17 @@ class Tests_Comment_WpAllowComment extends WP_UnitTestCase {
function setUp() {
parent::setUp();
self::$post_id = self::factory()->post->create();
self::$comment_id = self::factory()->comment->create( array(
'comment_post_ID' => self::$post_id,
'comment_approved' => '1',
'comment_author' => 'Bob',
'comment_author_email' => 'bobthebuilder@example.com',
'comment_author_url' => 'http://example.com',
'comment_content' => 'Yes, we can!',
) );
self::$post_id = self::factory()->post->create();
self::$comment_id = self::factory()->comment->create(
array(
'comment_post_ID' => self::$post_id,
'comment_approved' => '1',
'comment_author' => 'Bob',
'comment_author_email' => 'bobthebuilder@example.com',
'comment_author_url' => 'http://example.com',
'comment_content' => 'Yes, we can!',
)
);
update_option( 'comment_whitelist', 0 );
}
@@ -31,18 +33,18 @@ class Tests_Comment_WpAllowComment extends WP_UnitTestCase {
}
public function test_allow_comment_if_comment_author_emails_differ() {
$now = time();
$now = time();
$comment_data = array(
'comment_post_ID' => self::$post_id,
'comment_author' => 'Bob',
'comment_post_ID' => self::$post_id,
'comment_author' => 'Bob',
'comment_author_email' => 'sideshowbob@example.com',
'comment_author_url' => 'http://example.com',
'comment_content' => 'Yes, we can!',
'comment_author_IP' => '192.168.0.1',
'comment_parent' => 0,
'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ),
'comment_agent' => 'Bobbot/2.1',
'comment_type' => '',
'comment_author_url' => 'http://example.com',
'comment_content' => 'Yes, we can!',
'comment_author_IP' => '192.168.0.1',
'comment_parent' => 0,
'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ),
'comment_agent' => 'Bobbot/2.1',
'comment_type' => '',
);
$result = wp_allow_comment( $comment_data );
@@ -54,18 +56,18 @@ class Tests_Comment_WpAllowComment extends WP_UnitTestCase {
* @expectedException WPDieException
*/
public function test_die_as_duplicate_if_comment_author_name_and_emails_match() {
$now = time();
$now = time();
$comment_data = array(
'comment_post_ID' => self::$post_id,
'comment_author' => 'Bob',
'comment_post_ID' => self::$post_id,
'comment_author' => 'Bob',
'comment_author_email' => 'bobthebuilder@example.com',
'comment_author_url' => 'http://example.com',
'comment_content' => 'Yes, we can!',
'comment_author_IP' => '192.168.0.1',
'comment_parent' => 0,
'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ),
'comment_agent' => 'Bobbot/2.1',
'comment_type' => '',
'comment_author_url' => 'http://example.com',
'comment_content' => 'Yes, we can!',
'comment_author_IP' => '192.168.0.1',
'comment_parent' => 0,
'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ),
'comment_agent' => 'Bobbot/2.1',
'comment_type' => '',
);
$result = wp_allow_comment( $comment_data );