Fix undefined index notices in `comment/slashes` test cases. `wp_new_comment()` and `edit_comment()` expect more variables than were being passed.
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25365 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
eddb6d958b
commit
38474ef5d1
|
@ -22,6 +22,8 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||||
$this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
|
$this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
|
||||||
$this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
|
$this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
|
||||||
$this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
|
$this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
|
||||||
|
|
||||||
|
$_SERVER['REMOTE_ADDR'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function tearDown() {
|
function tearDown() {
|
||||||
|
@ -41,6 +43,9 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||||
$data = array(
|
$data = array(
|
||||||
'comment_post_ID' => $post_id,
|
'comment_post_ID' => $post_id,
|
||||||
'comment_author' => $this->slash_1,
|
'comment_author' => $this->slash_1,
|
||||||
|
'comment_author_url' => '',
|
||||||
|
'comment_author_email' => '',
|
||||||
|
'comment_type' => '',
|
||||||
'comment_content' => $this->slash_7,
|
'comment_content' => $this->slash_7,
|
||||||
);
|
);
|
||||||
$id = wp_new_comment( $data );
|
$id = wp_new_comment( $data );
|
||||||
|
@ -53,6 +58,9 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||||
$data = array(
|
$data = array(
|
||||||
'comment_post_ID' => $post_id,
|
'comment_post_ID' => $post_id,
|
||||||
'comment_author' => $this->slash_2,
|
'comment_author' => $this->slash_2,
|
||||||
|
'comment_author_url' => '',
|
||||||
|
'comment_author_email' => '',
|
||||||
|
'comment_type' => '',
|
||||||
'comment_content' => $this->slash_4,
|
'comment_content' => $this->slash_4,
|
||||||
);
|
);
|
||||||
$id = wp_new_comment( $data );
|
$id = wp_new_comment( $data );
|
||||||
|
@ -77,7 +85,10 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||||
// as slashes are not permitted in that data
|
// as slashes are not permitted in that data
|
||||||
$_POST = array();
|
$_POST = array();
|
||||||
$_POST['comment_ID'] = $comment_id;
|
$_POST['comment_ID'] = $comment_id;
|
||||||
|
$_POST['comment_status'] = '';
|
||||||
$_POST['newcomment_author'] = $this->slash_1;
|
$_POST['newcomment_author'] = $this->slash_1;
|
||||||
|
$_POST['newcomment_author_url'] = '';
|
||||||
|
$_POST['newcomment_author_email'] = '';
|
||||||
$_POST['content'] = $this->slash_7;
|
$_POST['content'] = $this->slash_7;
|
||||||
$_POST = add_magic_quotes( $_POST );
|
$_POST = add_magic_quotes( $_POST );
|
||||||
|
|
||||||
|
@ -89,7 +100,10 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||||
|
|
||||||
$_POST = array();
|
$_POST = array();
|
||||||
$_POST['comment_ID'] = $comment_id;
|
$_POST['comment_ID'] = $comment_id;
|
||||||
|
$_POST['comment_status'] = '';
|
||||||
$_POST['newcomment_author'] = $this->slash_2;
|
$_POST['newcomment_author'] = $this->slash_2;
|
||||||
|
$_POST['newcomment_author_url'] = '';
|
||||||
|
$_POST['newcomment_author_email'] = '';
|
||||||
$_POST['content'] = $this->slash_4;
|
$_POST['content'] = $this->slash_4;
|
||||||
$_POST = add_magic_quotes( $_POST );
|
$_POST = add_magic_quotes( $_POST );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue