mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin. See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/ Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin. See #28721. See #31089. Fixes #30937. Fixes #31517. Fixes #30028. Fixes #23225. Fixes #34142. Fixes #36485. git-svn-id: https://develop.svn.wordpress.org/trunk@38810 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -550,4 +550,37 @@ class Tests_AdminBar extends WP_UnitTestCase {
|
||||
|
||||
$this->assertNull( $node );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 30937
|
||||
* @covers wp_admin_bar_customize_menu()
|
||||
*/
|
||||
public function test_customize_link() {
|
||||
global $wp_customize;
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$uuid = wp_generate_uuid4();
|
||||
$this->go_to( home_url( "/?customize_changeset_uuid=$uuid" ) );
|
||||
wp_set_current_user( self::$admin_id );
|
||||
|
||||
$this->factory()->post->create( array(
|
||||
'post_type' => 'customize_changeset',
|
||||
'post_status' => 'auto-draft',
|
||||
'post_name' => $uuid,
|
||||
) );
|
||||
$wp_customize = new WP_Customize_Manager( array(
|
||||
'changeset_uuid' => $uuid,
|
||||
) );
|
||||
$wp_customize->start_previewing_theme();
|
||||
|
||||
set_current_screen( 'front' );
|
||||
$wp_admin_bar = $this->get_standard_admin_bar();
|
||||
$node = $wp_admin_bar->get_node( 'customize' );
|
||||
$this->assertNotEmpty( $node );
|
||||
|
||||
$parsed_url = wp_parse_url( $node->href );
|
||||
$query_params = array();
|
||||
wp_parse_str( $parsed_url['query'], $query_params );
|
||||
$this->assertEquals( $uuid, $query_params['changeset_uuid'] );
|
||||
$this->assertNotContains( 'changeset_uuid', $query_params['url'] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user