Changeset 48937 for trunk/tests/phpunit/tests/comment/template.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/template.php
r47366 r48937 8 8 $post_id = self::factory()->post->create(); 9 9 10 $this->assert Equals( 0, get_comments_number( 0 ) );11 $this->assert Equals( 0, get_comments_number( $post_id ) );12 $this->assert Equals( 0, get_comments_number( get_post( $post_id ) ) );10 $this->assertSame( 0, get_comments_number( 0 ) ); 11 $this->assertSame( '0', get_comments_number( $post_id ) ); 12 $this->assertSame( '0', get_comments_number( get_post( $post_id ) ) ); 13 13 14 14 self::factory()->comment->create_post_comments( $post_id, 12 ); 15 15 16 $this->assert Equals( 12, get_comments_number( $post_id ) );17 $this->assert Equals( 12, get_comments_number( get_post( $post_id ) ) );16 $this->assertSame( '12', get_comments_number( $post_id ) ); 17 $this->assertSame( '12', get_comments_number( get_post( $post_id ) ) ); 18 18 } 19 19 … … 23 23 $this->go_to( $permalink ); 24 24 25 $this->assert Equals( 0, get_comments_number() );25 $this->assertSame( '0', get_comments_number() ); 26 26 27 27 self::factory()->comment->create_post_comments( $post_id, 12 ); 28 28 $this->go_to( $permalink ); 29 29 30 $this->assert Equals( 12, get_comments_number() );30 $this->assertSame( '12', get_comments_number() ); 31 31 } 32 32 … … 40 40 $comments_number_text = get_comments_number_text( false, false, false, $post_id ); 41 41 42 $this->assert Equals( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );42 $this->assertSame( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text ); 43 43 44 44 ob_start(); … … 46 46 $comments_number_text = ob_get_clean(); 47 47 48 $this->assert Equals( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );48 $this->assertSame( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text ); 49 49 50 50 } … … 58 58 $this->go_to( $permalink ); 59 59 60 $this->assert Equals( __( 'No Comments' ), get_comments_number_text() );60 $this->assertSame( __( 'No Comments' ), get_comments_number_text() ); 61 61 62 62 $this->factory->comment->create_post_comments( $post_id, 1 ); 63 63 $this->go_to( $permalink ); 64 64 65 $this->assert Equals( __( '1 Comment' ), get_comments_number_text() );65 $this->assertSame( __( '1 Comment' ), get_comments_number_text() ); 66 66 67 67 $this->factory->comment->create_post_comments( $post_id, 1 ); 68 68 $this->go_to( $permalink ); 69 69 70 $this->assert Equals( sprintf( _n( '%s Comment', '%s Comments', 2 ), '2' ), get_comments_number_text() );70 $this->assertSame( sprintf( _n( '%s Comment', '%s Comments', 2 ), '2' ), get_comments_number_text() ); 71 71 72 72 } … … 85 85 add_filter( 'gettext_with_context', array( $this, '_enable_comment_number_declension' ), 10, 4 ); 86 86 87 $this->assert Equals( $output, get_comments_number_text( false, false, $input ) );87 $this->assertSame( $output, get_comments_number_text( false, false, $input ) ); 88 88 89 89 remove_filter( 'gettext_with_context', array( $this, '_enable_comment_number_declension' ), 10, 4 );
Note: See TracChangeset
for help on using the changeset viewer.