Changeset 51079 for trunk/tests/phpunit/tests/block-template-utils.php
- Timestamp:
- 06/07/2021 11:16:29 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-template-utils.php
r51003 r51079 41 41 42 42 $this->assertNotWPError( $template ); 43 $this->assert Equals( get_stylesheet() . '//my_template', $template->id );44 $this->assert Equals( get_stylesheet(), $template->theme );45 $this->assert Equals( 'my_template', $template->slug );46 $this->assert Equals( 'publish', $template->status );47 $this->assert Equals( 'custom', $template->source );48 $this->assert Equals( 'My Template', $template->title );49 $this->assert Equals( 'Description of my template', $template->description );50 $this->assert Equals( 'wp_template', $template->type );43 $this->assertSame( get_stylesheet() . '//my_template', $template->id ); 44 $this->assertSame( get_stylesheet(), $template->theme ); 45 $this->assertSame( 'my_template', $template->slug ); 46 $this->assertSame( 'publish', $template->status ); 47 $this->assertSame( 'custom', $template->source ); 48 $this->assertSame( 'My Template', $template->title ); 49 $this->assertSame( 'Description of my template', $template->description ); 50 $this->assertSame( 'wp_template', $template->type ); 51 51 } 52 52 … … 57 57 $id = get_stylesheet() . '//' . 'my_template'; 58 58 $template = get_block_template( $id, 'wp_template' ); 59 $this->assert Equals( $id, $template->id );60 $this->assert Equals( get_stylesheet(), $template->theme );61 $this->assert Equals( 'my_template', $template->slug );62 $this->assert Equals( 'publish', $template->status );63 $this->assert Equals( 'custom', $template->source );64 $this->assert Equals( 'wp_template', $template->type );59 $this->assertSame( $id, $template->id ); 60 $this->assertSame( get_stylesheet(), $template->theme ); 61 $this->assertSame( 'my_template', $template->slug ); 62 $this->assertSame( 'publish', $template->status ); 63 $this->assertSame( 'custom', $template->source ); 64 $this->assertSame( 'wp_template', $template->type ); 65 65 } 66 66 … … 88 88 $templates = get_block_templates( array( 'slug__in' => array( 'my_template' ) ), 'wp_template' ); 89 89 $template_ids = get_template_ids( $templates ); 90 $this->assert Equals( array( get_stylesheet() . '//' . 'my_template' ), $template_ids );90 $this->assertSame( array( get_stylesheet() . '//' . 'my_template' ), $template_ids ); 91 91 92 92 // Filter by CPT ID. 93 93 $templates = get_block_templates( array( 'wp_id' => self::$post->ID ), 'wp_template' ); 94 94 $template_ids = get_template_ids( $templates ); 95 $this->assert Equals( array( get_stylesheet() . '//' . 'my_template' ), $template_ids );95 $this->assertSame( array( get_stylesheet() . '//' . 'my_template' ), $template_ids ); 96 96 } 97 97 }
Note: See TracChangeset
for help on using the changeset viewer.