Changeset 48937 for trunk/tests/phpunit/tests/option/option.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/option/option.php
r47122 r48937 18 18 $this->assertFalse( get_option( 'doesnotexist' ) ); 19 19 $this->assertTrue( add_option( $key, $value ) ); 20 $this->assert Equals( $value, get_option( $key ) );20 $this->assertSame( $value, get_option( $key ) ); 21 21 $this->assertFalse( add_option( $key, $value ) ); // Already exists. 22 22 $this->assertFalse( update_option( $key, $value ) ); // Value is the same. 23 23 $this->assertTrue( update_option( $key, $value2 ) ); 24 $this->assert Equals( $value2, get_option( $key ) );24 $this->assertSame( $value2, get_option( $key ) ); 25 25 $this->assertFalse( add_option( $key, $value ) ); 26 $this->assert Equals( $value2, get_option( $key ) );26 $this->assertSame( $value2, get_option( $key ) ); 27 27 $this->assertTrue( delete_option( $key ) ); 28 28 $this->assertFalse( get_option( $key ) ); … … 30 30 31 31 $this->assertTrue( update_option( $key2, $value2 ) ); 32 $this->assert Equals( $value2, get_option( $key2 ) );32 $this->assertSame( $value2, get_option( $key2 ) ); 33 33 $this->assertTrue( delete_option( $key2 ) ); 34 34 $this->assertFalse( get_option( $key2 ) ); … … 42 42 // Default filter overrides $default arg. 43 43 add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 44 $this->assert Equals( 'foo', get_option( 'doesnotexist', 'bar' ) );44 $this->assertSame( 'foo', get_option( 'doesnotexist', 'bar' ) ); 45 45 46 46 // Remove the filter and the $default arg is honored. 47 47 remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 48 $this->assert Equals( 'bar', get_option( 'doesnotexist', 'bar' ) );48 $this->assertSame( 'bar', get_option( 'doesnotexist', 'bar' ) ); 49 49 50 50 // Once the option exists, the $default arg and the default filter are ignored. 51 51 add_option( 'doesnotexist', $value ); 52 $this->assert Equals( $value, get_option( 'doesnotexist', 'foo' ) );52 $this->assertSame( $value, get_option( 'doesnotexist', 'foo' ) ); 53 53 add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 54 $this->assert Equals( $value, get_option( 'doesnotexist', 'foo' ) );54 $this->assertSame( $value, get_option( 'doesnotexist', 'foo' ) ); 55 55 remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) ); 56 56 … … 80 80 81 81 $this->assertTrue( add_option( $key, $value ) ); 82 $this->assert Equals( $value, get_option( $key ) );82 $this->assertSame( $value, get_option( $key ) ); 83 83 84 84 $value = (object) $value; … … 139 139 140 140 $actual = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s LIMIT 1", $name ) ); 141 $this->assert Equals( $expected, $actual->autoload );141 $this->assertSame( $expected, $actual->autoload ); 142 142 } 143 143 }
Note: See TracChangeset
for help on using the changeset viewer.