/** * Tests display_post_states. * * @covers CustomizeSnapshots\Post_Type::display_post_states() */ public function test_display_post_states() { $post_type = new Post_Type($this->plugin->customize_snapshot_manager); $post_id = $post_type->save(array('uuid' => self::UUID, 'data' => array('foo' => array('value' => 'bar')))); $states = $post_type->display_post_states(array(), get_post($post_id)); $this->assertArrayNotHasKey('snapshot_error', $states); update_post_meta($post_id, 'snapshot_error_on_publish', true); $states = $post_type->display_post_states(array(), get_post($post_id)); $this->assertArrayHasKey('snapshot_error', $states); }