Add a `post_id` fixture in `test/meta/slashes.php` so `Undefined variable: comment_post_ID` notices don't fire when creating comments.

See #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25383 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2013-09-12 04:59:29 +00:00
parent 9cb4234c3f
commit 6ced366e7c
1 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ class Tests_Meta_Slashes extends WP_UnitTestCase {
function setUp() {
parent::setUp();
$this->author_id = $this->factory->user->create( array( 'role' => 'editor' ) );
$this->post_id = $this->factory->post->create();
$this->old_current_user = get_current_user_id();
wp_set_current_user( $this->author_id );
@ -173,7 +174,7 @@ class Tests_Meta_Slashes extends WP_UnitTestCase {
*
*/
function test_add_comment_meta() {
$id = $this->factory->comment->create();
$id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );
add_comment_meta( $id, 'slash_test_1', $this->slash_1 );
add_comment_meta( $id, 'slash_test_2', $this->slash_3 );
@ -197,7 +198,7 @@ class Tests_Meta_Slashes extends WP_UnitTestCase {
*
*/
function test_update_comment_meta() {
$id = $this->factory->comment->create();
$id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );
add_comment_meta( $id, 'slash_test_1', 'foo' );
add_comment_meta( $id, 'slash_test_2', 'foo' );