diff --git a/tests/phpunit/tests/option/themeMods.php b/tests/phpunit/tests/option/themeMods.php new file mode 100644 index 0000000000..8bd8f5d85c --- /dev/null +++ b/tests/phpunit/tests/option/themeMods.php @@ -0,0 +1,35 @@ +assertEquals( '', get_theme_mod( 'non_existent' ) ); + } + + function test_theme_mod_defined_default() { + $this->assertEquals( 'default', get_theme_mod( 'non_existent', 'default' ) ); + } + + function test_theme_mod_set() { + $expected = 'value'; + set_theme_mod( 'test_name', $expected ); + $this->assertEquals( $expected, get_theme_mod( 'test_name' ) ); + } + + function test_theme_mod_update() { + set_theme_mod( 'test_update', 'first_value' ); + $expected = 'updated_value'; + set_theme_mod( 'test_update', $expected ); + $this->assertEquals( $expected, get_theme_mod( 'test_update' ) ); + } + + function test_theme_mod_remove() { + set_theme_mod( 'test_remove', 'value' ); + remove_theme_mod( 'test_remove' ); + $this->assertEquals( '', get_theme_mod( 'test_remove' ) ); + } + +}