Changeset 45685 for trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
- Timestamp:
- 07/27/2019 12:43:56 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
r44310 r45685 16 16 17 17 return $relative; 18 } 19 20 public function plugins_url_custom_domain() { 21 return 'https://plugins.example.com'; 22 } 23 24 public function content_url_custom_domain_with_no_path() { 25 return 'https://content.example.com'; 18 26 } 19 27 … … 39 47 remove_filter( 'site_url', array( $this, 'site_url_subdirectory' ) ); 40 48 } 49 50 /** 51 * @ticket 46336 52 */ 53 public function test_resolve_relative_path_custom_plugins_url() { 54 $json_translations = file_get_contents( DIR_TESTDATA . '/languages/plugins/internationalized-plugin-en_US-2f86cb96a0233e7cb3b6f03ad573be0b.json' ); 55 56 add_filter( 'plugins_url', array( $this, 'plugins_url_custom_domain' ) ); 57 wp_enqueue_script( 'plugin-example-1', 'https://plugins.example.com/my-plugin/js/script.js', array(), null ); 58 $this->assertEquals( $json_translations, load_script_textdomain( 'plugin-example-1', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) ); 59 remove_filter( 'plugins_url', array( $this, 'plugins_url_custom_domain' ) ); 60 } 61 62 /** 63 * @ticket 46387 64 */ 65 public function test_resolve_relative_path_custom_content_url() { 66 $json_translations = file_get_contents( DIR_TESTDATA . '/languages/plugins/internationalized-plugin-en_US-2f86cb96a0233e7cb3b6f03ad573be0b.json' ); 67 68 add_filter( 'content_url', array( $this, 'content_url_custom_domain_with_no_path' ) ); 69 wp_enqueue_script( 'plugin-example-2', 'https://content.example.com/plugins/my-plugin/js/script.js', array(), null ); 70 $this->assertEquals( $json_translations, load_script_textdomain( 'plugin-example-2', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) ); 71 remove_filter( 'content_url', array( $this, 'content_url_custom_domain_with_no_path' ) ); 72 } 41 73 }
Note: See TracChangeset
for help on using the changeset viewer.