You appear to be a bot. Output may be restricted
Description
Test revision saving on initial save of Custom CSS.
Usage
Test_WP_Customize_Custom_CSS_Setting::test_custom_css_revision_saved();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/customize/custom-css-setting.php
Lines:
1 to 29 of 29
function test_custom_css_revision_saved() { $inserted_css = 'body { background: black; }'; $updated_css = 'body { background: red; }'; $post = wp_update_custom_css_post( $inserted_css, array( 'stylesheet' => 'testtheme', ) ); $this->assertSame( $inserted_css, $post->post_content ); $revisions = array_values( wp_get_post_revisions( $post ) ); $this->assertCount( 1, $revisions ); $this->assertSame( $inserted_css, $revisions[0]->post_content ); wp_update_custom_css_post( $updated_css, array( 'stylesheet' => 'testtheme', ) ); $revisions = array_values( wp_get_post_revisions( $post ) ); $this->assertCount( 2, $revisions ); $this->assertSame( $updated_css, $revisions[0]->post_content ); $this->assertSame( $inserted_css, $revisions[1]->post_content ); }