Index: tests/phpunit/tests/comment.php
===================================================================
--- tests/phpunit/tests/comment.php	(revision 31271)
+++ tests/phpunit/tests/comment.php	(working copy)
@@ -72,4 +72,94 @@
 
 		$this->assertSame( array(), $found );
 	}
+
+    public function test_check_comment() {
+        /*
+         * Setup
+         */
+        global $wpdb;
+        $post_args = array( 'post_title' => 'some-post', 'post_type' => 'post' );
+        $post      = $this->factory->post->create_and_get( $post_args );
+        $comment_args = array( 'comment_post_ID'      => $post->ID, 
+                               'comment_approved'     => '0', 
+                               'comment_content'      => 'This is a test comment.' ,
+                               'comment_approved'     =>0,
+                               'comment_author_email' => 'bob@example.com',
+                               'comment_author' => 'BobtheBuilder' );
+
+
+        /*
+         *  Test #1 Comment Whitelisting
+         */
+        update_option('comment_whitelist',0);
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertTrue($results);
+        update_option('comment_whitelist',1);
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertFalse($results);
+
+
+        /*
+         * Test 2: Must have at least 2 approved comments
+         */
+        $comment_args['comment_approved'] = 1;
+        $comment_ids = $this->factory->comment->create_post_comments($post->ID,5, $comment_args );
+        for($lcvA=0;$lcvA<count($comment_ids);$lcvA++) {
+            $comment = get_comment($comment_ids[$lcvA]);
+            $comment->comment_approved=0;
+            wp_update_comment((array)$comment);
+        }
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertFalse($results);
+
+        for($lcvA=0;$lcvA<count($comment_ids);$lcvA++) {
+            $comment = get_comment($comment_ids[$lcvA]);
+            $comment->comment_approved=1;
+            wp_update_comment((array)$comment);
+        }
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertTrue($results);
+        
+
+        /*
+         *  Test #3 Comment Moderation
+         */
+        update_option('comment_moderation',1);
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertFalse($results);
+        update_option('comment_moderation',0);
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertTrue($results);
+
+
+        /*
+         * Test #4 Number of comment links
+         */
+         $max_links = get_option( 'comment_max_links' );
+         $comment_content = $comment_args['comment_content'] . "\n";;
+         for($lcvA=0;$lcvA<$max_links;$lcvA++) {
+            $comment_content .= '<a href="'.home_url( '?p=' . rand() ) . '">Click Me!</a>' . "\n";
+         }
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', $comment_content , '192.168.0.1', '', '');
+        $this->assertFalse($results);
+        update_option('comment_max_links',5);
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', $comment_content , '192.168.0.1', '', '');
+        $this->assertTrue($results);
+
+
+        /*
+         * Test #5 Moderated keywords
+         */
+        update_option('moderation_keys',"poop\nhiney\ncomment");
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertFalse($results);
+        update_option('moderation_keys',"poop\nhiney\n");
+        $results = check_comment('BobtheBuilder', 'bob@example.com', 'http://example.com', 'This is a test comment.' , '192.168.0.1', '', '');
+        $this->assertTrue($results);
+
+        return;
+
+    }
+
 }
+
