Changeset 49863
- Timestamp:
- 12/22/2020 07:42:23 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/template.php
r49849 r49863 4 4 */ 5 5 class Tests_Comment_Template extends WP_UnitTestCase { 6 /** 7 * Shared post ID. 8 * 9 * @var int 10 */ 11 public static $post_id; 12 13 /** 14 * Set up shared fixtures. 15 * 16 * @param WP_UnitTest_Factory $factory Unit test factory. 17 */ 18 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 19 self::$post_id = self::factory()->post->create(); 20 } 6 21 7 22 function test_get_comments_number() { 8 $post_id = self:: factory()->post->create();23 $post_id = self::$post_id; 9 24 10 25 $this->assertSame( 0, get_comments_number( 0 ) ); … … 19 34 20 35 function test_get_comments_number_without_arg() { 21 $post_id = self:: factory()->post->create();36 $post_id = self::$post_id; 22 37 $permalink = get_permalink( $post_id ); 23 38 $this->go_to( $permalink ); … … 35 50 */ 36 51 function test_get_comments_number_text_with_post_id() { 37 $post_id = $this->factory->post->create();52 $post_id = self::$post_id; 38 53 $this->factory->comment->create_post_comments( $post_id, 6 ); 39 54 … … 54 69 */ 55 70 function test_get_comments_number_text_declension_with_default_args() { 56 $post_id = $this->factory->post->create();71 $post_id = self::$post_id; 57 72 $permalink = get_permalink( $post_id ); 58 73 $this->go_to( $permalink ); … … 77 92 */ 78 93 function test_get_comments_number_text_declension_with_custom_args( $number, $input, $output ) { 79 $post_id = $this->factory->post->create();94 $post_id = self::$post_id; 80 95 $permalink = get_permalink( $post_id ); 81 96
Note: See TracChangeset
for help on using the changeset viewer.