Changeset 50284 for trunk/tests/phpunit/tests/https-migration.php
- Timestamp:
- 02/10/2021 01:24:24 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/https-migration.php
r50131 r50284 62 62 // Replaces URLs, including its encoded variant. 63 63 add_filter( 'wp_should_replace_insecure_home_url', '__return_true' ); 64 $this->assert Equals( $https_content, wp_replace_insecure_home_url( $http_content ) );64 $this->assertSame( $https_content, wp_replace_insecure_home_url( $http_content ) ); 65 65 66 66 // Does not replace anything if determined as unnecessary. 67 67 add_filter( 'wp_should_replace_insecure_home_url', '__return_false' ); 68 $this->assert Equals( $http_content, wp_replace_insecure_home_url( $http_content ) );68 $this->assertSame( $http_content, wp_replace_insecure_home_url( $http_content ) ); 69 69 } 70 70 … … 87 87 // Update URLs to HTTPS (successfully). 88 88 $this->assertTrue( wp_update_urls_to_https() ); 89 $this->assert Equals( $https_url, get_option( 'home' ) );90 $this->assert Equals( $https_url, get_option( 'siteurl' ) );89 $this->assertSame( $https_url, get_option( 'home' ) ); 90 $this->assertSame( $https_url, get_option( 'siteurl' ) ); 91 91 92 92 // Switch options back to use HTTP URLs, but now add filter to … … 99 99 // option. Therefore the change is expected to be reverted. 100 100 $this->assertFalse( wp_update_urls_to_https() ); 101 $this->assert Equals( $http_url, get_option( 'home' ) );102 $this->assert Equals( $http_url, get_option( 'siteurl' ) );101 $this->assertSame( $http_url, get_option( 'home' ) ); 102 $this->assertSame( $http_url, get_option( 'siteurl' ) ); 103 103 } 104 104 … … 110 110 update_option( 'fresh_site', '0' ); 111 111 wp_update_https_migration_required( 'http://example.org', 'https://example.org' ); 112 $this->assert Equals( '1',get_option( 'https_migration_required' ) );112 $this->assertTrue( get_option( 'https_migration_required' ) ); 113 113 114 114 // Changing another part than the scheme should delete/reset the flag because changing those parts (e.g. the … … 120 120 update_option( 'fresh_site', '1' ); 121 121 wp_update_https_migration_required( 'http://example.org', 'https://example.org' ); 122 $this->assert Equals( '',get_option( 'https_migration_required' ) );122 $this->assertFalse( get_option( 'https_migration_required' ) ); 123 123 124 124 // Changing (back) from HTTPS to HTTP should delete/reset the flag.
Note: See TracChangeset
for help on using the changeset viewer.