WordPress.org

Plugin Directory

Changeset 534262


Ignore:
Timestamp:
04/20/12 20:21:13 (2 years ago)
Author:
josephscott
Message:

Make it easy to use a different post id when running the tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • akismet/tests/basic-tests.php

    r443561 r534262  
    11<?php 
     2define( 'AKISMET_TEST_POST_ID', 1 ); 
    23 
    34class TestAkismetVersion extends UnitTestCase { 
     
    2425 
    2526        $this->comment_id = wp_insert_comment( array( 
    26             'comment_post_ID' => 1, 
     27            'comment_post_ID' => AKISMET_TEST_POST_ID, 
    2728            'comment_author' => $this->comment_author, 
    2829            'comment_author_email' => 'alex@example.com', 
     
    9798    function test_state_after_retry_moderation() { 
    9899        // turn on moderation 
    99         update_option('comment_moderation', 1); 
     100        update_option('comment_moderation', AKISMET_TEST_POST_ID); 
    100101         
    101102        // trigger a cron event and make sure the error status is replaced with 'false' (not spam) 
     
    165166    function test_state_after_retry_moderation() { 
    166167        // turn on moderation 
    167         update_option('comment_moderation', 1); 
     168        update_option('comment_moderation', AKISMET_TEST_POST_ID); 
    168169         
    169170        // trigger a cron event and make sure the error status is replaced with 'false' (not spam) 
     
    218219        for ( $i=0; $i < 101; $i++ ) { 
    219220            $id = wp_insert_comment( array( 
    220                 'comment_post_ID' => 1, 
     221                'comment_post_ID' => AKISMET_TEST_POST_ID, 
    221222                'comment_author' => $this->comment_author, 
    222223                'comment_author_email' => 'alex@example.com', 
     
    309310         
    310311        $this->comment = array( 
    311             'comment_post_ID' => 1, 
     312            'comment_post_ID' => AKISMET_TEST_POST_ID, 
    312313            'comment_author' => $this->comment_author, 
    313314            'comment_author_email' => 'alex@example.com', 
     
    435436         
    436437        $this->comment = array( 
    437             'comment_post_ID' => 1, 
     438            'comment_post_ID' => AKISMET_TEST_POST_ID, 
    438439            'comment_author' => $this->comment_author, 
    439440            'comment_author_email' => 'alex@example.com', 
     
    659660         
    660661        $this->comment_id = wp_insert_comment( array( 
    661             'comment_post_ID' => 1, 
     662            'comment_post_ID' => AKISMET_TEST_POST_ID, 
    662663            'comment_author' => $this->comment_author, 
    663664            'comment_author_email' => 'alex@example.com', 
     
    747748        // a non-spam comment will not be deleted 
    748749        $this->comment_id = wp_insert_comment( array( 
    749             'comment_post_ID' => 1, 
     750            'comment_post_ID' => AKISMET_TEST_POST_ID, 
    750751            'comment_author' => $this->comment_author, 
    751752            'comment_author_email' => 'alex@example.com', 
Note: See TracChangeset for help on using the changeset viewer.