Skip to content

Commit

Permalink
Dev domains: remmove and replace by .test tld. (#11388)
Browse files Browse the repository at this point in the history
The .dev TLD will soon become available to everyone, and we consequently cannot continue to consider it
a local test TLD anymore. This commit replaces all .dev references by .test ones.
  • Loading branch information
jeherve committed Feb 21, 2019
1 parent e59cb37 commit c3ab561
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions class.jetpack-data.php
Expand Up @@ -74,17 +74,17 @@ public static function is_usable_domain( $domain, $extra = array() ) {
'localhost',
'localhost.localdomain',
'127.0.0.1',
'local.wordpress.dev', // VVV
'local.wordpress-trunk.dev', // VVV
'src.wordpress-develop.dev', // VVV
'build.wordpress-develop.dev', // VVV
'local.wordpress.test', // VVV
'local.wordpress-trunk.test', // VVV
'src.wordpress-develop.test', // VVV
'build.wordpress-develop.test', // VVV
);
if ( in_array( $domain, $forbidden_domains ) ) {
return new WP_Error( 'fail_domain_forbidden', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it is in the forbidden array.', 'jetpack' ), $domain ) );
}

// No .dev or .local domains
if ( preg_match( '#\.(dev|local)$#i', $domain ) ) {
// No .test or .local domains
if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
return new WP_Error( 'fail_domain_tld', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.', 'jetpack' ), $domain ) );
}

Expand Down
52 changes: 26 additions & 26 deletions tests/php/test_functions.photon.php
Expand Up @@ -115,10 +115,10 @@ public function test_photon_url_no_filter_photonized_https_to_http() {
* @group jetpack_photon_filter_http
*/
public function test_photon_url_filter_http_http() {
$this->apply_custom_domain( 'http://photon.dev' );
$this->apply_custom_domain( 'http://photon.test' );
$url = jetpack_photon_url( 'http://example.com/img.jpg' );

$this->assertEquals( 'http://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'http://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -128,10 +128,10 @@ public function test_photon_url_filter_http_http() {
* @group jetpack_photon_filter_http
*/
public function test_photon_url_filter_http_http_to_http() {
$this->apply_custom_domain( 'http://photon.dev' );
$this->apply_custom_domain( 'http://photon.test' );
$url = jetpack_photon_url( 'http://example.com/img.jpg', array(), 'http' );

$this->assertEquals( 'http://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'http://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -141,10 +141,10 @@ public function test_photon_url_filter_http_http_to_http() {
* @group jetpack_photon_filter_http
*/
public function test_photon_url_filter_http_photonized_http() {
$this->apply_custom_domain( 'http://photon.dev' );
$url = jetpack_photon_url( 'http://photon.dev/example.com/img.jpg' );
$this->apply_custom_domain( 'http://photon.test' );
$url = jetpack_photon_url( 'http://photon.test/example.com/img.jpg' );

$this->assertEquals( 'http://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'http://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -154,10 +154,10 @@ public function test_photon_url_filter_http_photonized_http() {
* @group jetpack_photon_filter_http
*/
public function test_photon_url_filter_http_photonized_https() {
$this->apply_custom_domain( 'http://photon.dev' );
$url = jetpack_photon_url( 'https://photon.dev/example.com/img.jpg' );
$this->apply_custom_domain( 'http://photon.test' );
$url = jetpack_photon_url( 'https://photon.test/example.com/img.jpg' );

$this->assertEquals( 'https://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'https://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -167,10 +167,10 @@ public function test_photon_url_filter_http_photonized_https() {
* @group jetpack_photon_filter_http
*/
public function test_photon_url_filter_http_photonized_http_to_https() {
$this->apply_custom_domain( 'http://photon.dev' );
$url = jetpack_photon_url( 'http://photon.dev/example.com/img.jpg', array(), 'https' );
$this->apply_custom_domain( 'http://photon.test' );
$url = jetpack_photon_url( 'http://photon.test/example.com/img.jpg', array(), 'https' );

$this->assertEquals( 'https://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'https://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -180,10 +180,10 @@ public function test_photon_url_filter_http_photonized_http_to_https() {
* @group jetpack_photon_filter_network_path
*/
public function test_photon_url_filter_network_path_http() {
$this->apply_custom_domain( '//photon.dev' );
$this->apply_custom_domain( '//photon.test' );
$url = jetpack_photon_url( 'http://example.com/img.jpg' );

$this->assertEquals( '//photon.dev/example.com/img.jpg', $url );
$this->assertEquals( '//photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -193,10 +193,10 @@ public function test_photon_url_filter_network_path_http() {
* @group jetpack_photon_filter_network_path
*/
public function test_photon_url_filter_network_path_http_to_http() {
$this->apply_custom_domain( '//photon.dev' );
$this->apply_custom_domain( '//photon.test' );
$url = jetpack_photon_url( 'http://example.com/img.jpg', array(), 'http' );

$this->assertEquals( 'http://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'http://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -206,10 +206,10 @@ public function test_photon_url_filter_network_path_http_to_http() {
* @group jetpack_photon_filter_network_path
*/
public function test_photon_url_filter_network_path_photonized_http() {
$this->apply_custom_domain( '//photon.dev' );
$url = jetpack_photon_url( 'http://photon.dev/example.com/img.jpg' );
$this->apply_custom_domain( '//photon.test' );
$url = jetpack_photon_url( 'http://photon.test/example.com/img.jpg' );

$this->assertEquals( 'http://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'http://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -219,10 +219,10 @@ public function test_photon_url_filter_network_path_photonized_http() {
* @group jetpack_photon_filter_network_path
*/
public function test_photon_url_filter_network_path_photonized_https() {
$this->apply_custom_domain( '//photon.dev' );
$url = jetpack_photon_url( 'https://photon.dev/example.com/img.jpg' );
$this->apply_custom_domain( '//photon.test' );
$url = jetpack_photon_url( 'https://photon.test/example.com/img.jpg' );

$this->assertEquals( 'https://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'https://photon.test/example.com/img.jpg', $url );
}

/**
Expand All @@ -232,10 +232,10 @@ public function test_photon_url_filter_network_path_photonized_https() {
* @group jetpack_photon_filter_network_path
*/
public function test_photon_url_filter_network_path_photonized_to_https() {
$this->apply_custom_domain( '//photon.dev' );
$url = jetpack_photon_url( '//photon.dev/example.com/img.jpg', array(), 'https' );
$this->apply_custom_domain( '//photon.test' );
$url = jetpack_photon_url( '//photon.test/example.com/img.jpg', array(), 'https' );

$this->assertEquals( 'https://photon.dev/example.com/img.jpg', $url );
$this->assertEquals( 'https://photon.test/example.com/img.jpg', $url );
}

/**
Expand Down

0 comments on commit c3ab561

Please sign in to comment.