Changeset 48937 for trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
r46586 r48937 33 33 34 34 wp_enqueue_script( 'test-example-root', '/wp-includes/js/script.js', array(), null ); 35 $this->assert Equals( $json_translations, load_script_textdomain( 'test-example-root', 'default', DIR_TESTDATA . '/languages' ) );35 $this->assertSame( $json_translations, load_script_textdomain( 'test-example-root', 'default', DIR_TESTDATA . '/languages' ) ); 36 36 37 37 // Assets on a CDN. 38 38 add_filter( 'load_script_textdomain_relative_path', array( $this, 'relative_path_from_cdn' ), 10, 2 ); 39 39 wp_enqueue_script( 'test-example-cdn', 'https://my-cdn.com/wordpress/wp-includes/js/script.js', array(), null ); 40 $this->assert Equals( $json_translations, load_script_textdomain( 'test-example-cdn', 'default', DIR_TESTDATA . '/languages' ) );40 $this->assertSame( $json_translations, load_script_textdomain( 'test-example-cdn', 'default', DIR_TESTDATA . '/languages' ) ); 41 41 remove_filter( 'load_script_textdomain_relative_path', array( $this, 'relative_path_from_cdn' ) ); 42 42 … … 44 44 add_filter( 'site_url', array( $this, 'site_url_subdirectory' ) ); 45 45 wp_enqueue_script( 'test-example-subdir', '/wp/wp-includes/js/script.js', array(), null ); 46 $this->assert Equals( $json_translations, load_script_textdomain( 'test-example-subdir', 'default', DIR_TESTDATA . '/languages' ) );46 $this->assertSame( $json_translations, load_script_textdomain( 'test-example-subdir', 'default', DIR_TESTDATA . '/languages' ) ); 47 47 remove_filter( 'site_url', array( $this, 'site_url_subdirectory' ) ); 48 48 } … … 56 56 add_filter( 'plugins_url', array( $this, 'plugins_url_custom_domain' ) ); 57 57 wp_enqueue_script( 'plugin-example-1', 'https://plugins.example.com/my-plugin/js/script.js', array(), null ); 58 $this->assert Equals( $json_translations, load_script_textdomain( 'plugin-example-1', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) );58 $this->assertSame( $json_translations, load_script_textdomain( 'plugin-example-1', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) ); 59 59 remove_filter( 'plugins_url', array( $this, 'plugins_url_custom_domain' ) ); 60 60 } … … 68 68 add_filter( 'content_url', array( $this, 'content_url_custom_domain_with_no_path' ) ); 69 69 wp_enqueue_script( 'plugin-example-2', 'https://content.example.com/plugins/my-plugin/js/script.js', array(), null ); 70 $this->assert Equals( $json_translations, load_script_textdomain( 'plugin-example-2', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) );70 $this->assertSame( $json_translations, load_script_textdomain( 'plugin-example-2', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) ); 71 71 remove_filter( 'content_url', array( $this, 'content_url_custom_domain_with_no_path' ) ); 72 72 }
Note: See TracChangeset
for help on using the changeset viewer.