/** * 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.'); }
/** * Test snapshot settings. * * @see Customize_Snapshot::settings() */ function test_settings() { $_REQUEST['customize_snapshot_uuid'] = self::UUID; $manager = new Customize_Snapshot_Manager($this->plugin); $manager->init(); $this->assertEmpty($manager->snapshot()->settings()); $manager->snapshot()->set(array('foo' => array('value' => 'foo_default'))); $this->assertNotEmpty($manager->snapshot()->settings()); }