Make WordPress Core

Ticket #27998: 27998-unit-tests.diff

File 27998-unit-tests.diff, 687 bytes (added by aaroncampbell, 12 years ago)
  • tests/phpunit/tests/user/author.php

     
    7575                $this->assertEquals( '', get_the_author_meta( 'user_login' ) );
    7676                $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) );
    7777        }
    78 }
    79  No newline at end of file
     78
     79        function test_get_the_author_posts() {
     80                // Test with no global post, result should be 0 because no author is found
     81                $this->assertEquals( 0, get_the_author_posts() );
     82                $GLOBALS['post'] = $this->post_id;
     83                $this->assertEquals( 1, get_the_author_posts() );
     84        }
     85}