- Timestamp:
- 06/07/2021 11:16:29 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-templates-controller.php
r51003 r51079 81 81 $data = $response->get_data(); 82 82 83 $this->assert Equals(83 $this->assertSame( 84 84 array( 85 85 'id' => 'default//my_template', 86 86 'theme' => 'default', 87 87 'slug' => 'my_template', 88 'source' => 'custom', 89 'type' => 'wp_template', 90 'description' => 'Description of my template.', 88 91 'title' => array( 89 92 'raw' => 'My Template', 90 93 'rendered' => 'My Template', 91 94 ), 92 'description' => 'Description of my template.',93 95 'status' => 'publish', 94 'source' => 'custom',95 'type' => 'wp_template',96 96 'wp_id' => self::$post->ID, 97 97 'has_theme_file' => false, … … 109 109 unset( $data['_links'] ); 110 110 111 $this->assert Equals(111 $this->assertSame( 112 112 array( 113 113 'id' => 'default//my_template', 114 114 'theme' => 'default', 115 115 'slug' => 'my_template', 116 'source' => 'custom', 117 'type' => 'wp_template', 118 'description' => 'Description of my template.', 116 119 'title' => array( 117 120 'raw' => 'My Template', 118 121 'rendered' => 'My Template', 119 122 ), 120 'description' => 'Description of my template.',121 123 'status' => 'publish', 122 'source' => 'custom',123 'type' => 'wp_template',124 124 'wp_id' => self::$post->ID, 125 125 'has_theme_file' => false, … … 135 135 array( 136 136 'slug' => 'my_custom_template', 137 'description' => 'Just a description', 137 138 'title' => 'My Template', 138 'description' => 'Just a description',139 139 'content' => 'Content', 140 140 ) … … 145 145 unset( $data['wp_id'] ); 146 146 147 $this->assert Equals(147 $this->assertSame( 148 148 array( 149 149 'id' => 'default//my_custom_template', 150 150 'theme' => 'default', 151 'content' => array( 152 'raw' => 'Content', 153 ), 151 154 'slug' => 'my_custom_template', 155 'source' => 'custom', 156 'type' => 'wp_template', 157 'description' => 'Just a description', 152 158 'title' => array( 153 159 'raw' => 'My Template', 154 160 'rendered' => 'My Template', 155 161 ), 156 'description' => 'Just a description',157 162 'status' => 'publish', 158 'source' => 'custom',159 'type' => 'wp_template',160 'content' => array(161 'raw' => 'Content',162 ),163 163 'has_theme_file' => false, 164 164 ), … … 177 177 $response = rest_get_server()->dispatch( $request ); 178 178 $data = $response->get_data(); 179 $this->assert Equals( 'My new Index Title', $data['title']['raw'] );180 $this->assert Equals( 'custom', $data['source'] );179 $this->assertSame( 'My new Index Title', $data['title']['raw'] ); 180 $this->assertSame( 'custom', $data['source'] ); 181 181 } 182 182
Note: See TracChangeset
for help on using the changeset viewer.