diff --git a/tests/phpunit/tests/rewrite.php b/tests/phpunit/tests/rewrite.php index 1f7426e3d3..5db9eddc18 100644 --- a/tests/phpunit/tests/rewrite.php +++ b/tests/phpunit/tests/rewrite.php @@ -320,4 +320,19 @@ class Tests_Rewrite extends WP_UnitTestCase { $this->set_permalink_structure(); } + /** + * @ticket 29107 + */ + public function test_flush_rules_does_not_delete_option() { + $this->set_permalink_structure(); + + $rewrite_rules = get_option( 'rewrite_rules' ); + $this->assertSame( '', $rewrite_rules ); + + $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); + + $rewrite_rules = get_option( 'rewrite_rules' ); + $this->assertInternalType( 'array', $rewrite_rules ); + $this->assertNotEmpty( $rewrite_rules ); + } }