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