Changeset 31473 for trunk/tests/phpunit/tests/option/option.php
- Timestamp:
- 02/18/2015 07:13:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/option/option.php
r31278 r31473 58 58 $this->assertTrue( delete_option( 'doesnotexist' ) ); 59 59 $this->assertFalse( get_option( 'doesnotexist' ) ); 60 } 61 62 /** 63 * @ticket 31047 64 */ 65 public function test_add_option_should_respect_default_option_filter() { 66 add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 67 $added = add_option( 'doesnotexist', 'bar' ); 68 remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 69 70 $this->assertTrue( $added ); 71 $this->assertSame( 'bar', get_option( 'doesnotexist' ) ); 72 } 73 74 /** 75 * @ticket 31047 76 */ 77 public function test_update_option_should_respect_default_option_filter_when_option_does_not_yet_exist_in_database() { 78 add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 79 $added = update_option( 'doesnotexist', 'bar' ); 80 remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 81 82 $this->assertTrue( $added ); 83 $this->assertSame( 'bar', get_option( 'doesnotexist' ) ); 60 84 } 61 85
Note: See TracChangeset
for help on using the changeset viewer.