/**
  * Helper function to make the Ajax call directy to `Customize_Snapshot_Manager::save_snapshot`.
  *
  * @see Customize_Snapshot_Manager::save_snapshot()
  */
 function make_save_snapshot_ajax_call()
 {
     try {
         ini_set('implicit_flush', false);
         ob_start();
         $manager = new Customize_Snapshot_Manager($this->plugin);
         $manager->publish_snapshot_with_customize_save_after();
         $buffer = ob_get_clean();
         if (!empty($buffer)) {
             $this->_last_response = $buffer;
         }
     } catch (\WPAjaxDieContinueException $e) {
         unset($e);
     }
 }
 /**
  * Test publish snapshot with customize_save_after.
  *
  * @covers CustomizeSnapshots\Customize_Snapshot_Manager::publish_snapshot_with_customize_save_after()
  */
 function test_publish_snapshot_with_customize_save_after()
 {
     wp_set_current_user($this->user_id);
     $this->do_customize_boot_actions(true);
     $_POST = array('nonce' => wp_create_nonce('save-customize_' . $this->wp_customize->get_stylesheet()), 'customize_snapshot_uuid' => self::UUID, 'customized' => '{"foo":"foo_default","bar":"bar_default"}');
     $_REQUEST['action'] = 'customize_save';
     $_REQUEST['customize_snapshot_uuid'] = self::UUID;
     $manager = new Customize_Snapshot_Manager($this->plugin);
     $manager->init();
     $this->assertEmpty($manager->snapshot()->post());
     $manager->publish_snapshot_with_customize_save_after();
     $this->assertNotEmpty($manager->snapshot()->post());
     $this->markTestIncomplete('Need to test when snapshot->save() returns errors, and when snapshot post save fails.');
 }