| 131 | /** |
| 132 | * @ticket 47574 |
| 133 | */ |
| 134 | function test_getoembed_response_data_with_public_true_custom_post_status() { |
| 135 | // Custom status with public=true. |
| 136 | register_post_status( 'public', array( 'public' => true ) ); |
| 137 | |
| 138 | $post = self::factory()->post->create_and_get( |
| 139 | array( |
| 140 | 'post_status' => 'public', |
| 141 | ) |
| 142 | ); |
| 143 | |
| 144 | $this->assertNotFalse( get_oembed_response_data( $post, 100 ) ); |
| 145 | |
| 146 | _unregister_post_status( 'public' ); |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * @ticket 47574 |
| 151 | */ |
| 152 | function test_getoembed_response_data_with_public_false_custom_post_status() { |
| 153 | // Custom status with public=false. |
| 154 | register_post_status( 'privatfoo', array( 'public' => false ) ); |
| 155 | |
| 156 | $post = self::factory()->post->create_and_get( |
| 157 | array( |
| 158 | 'post_status' => 'privatfoo', |
| 159 | ) |
| 160 | ); |
| 161 | |
| 162 | $this->assertFalse( get_oembed_response_data( $post, 100 ) ); |
| 163 | |
| 164 | _unregister_post_status( 'privatfoo' ); |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * @ticket 47574 |
| 169 | */ |
| 170 | function test_getoembed_response_data_with_unregistered_custom_post_status() { |
| 171 | |
| 172 | $post = self::factory()->post->create_and_get( |
| 173 | array( |
| 174 | 'post_status' => 'unkownfoo', |
| 175 | ) |
| 176 | ); |
| 177 | |
| 178 | $this->assertFalse( get_oembed_response_data( $post, 100 ) ); |
| 179 | |
| 180 | } |
| 181 | |