Skip to content

Commit 9d7bc51

Browse files
Tests: Remove leftover trailingslashit() calls in WP_Textdomain_Registry tests.
Follow-up to [57287], [57290]. See #58919. git-svn-id: https://develop.svn.wordpress.org/trunk@57298 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 68fd1e3 commit 9d7bc51

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

tests/phpunit/tests/l10n/wpTextdomainRegistry.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function test_set_custom_path() {
4949
'Custom path for textdomain not returned'
5050
);
5151
$this->assertNotFalse(
52-
wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'bar/' ), 'translations' ),
52+
wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/bar/' ), 'translations' ),
5353
'List of files in custom path not cached'
5454
);
5555
}
@@ -84,15 +84,15 @@ public function test_set_populates_cache() {
8484
* @covers ::get_language_files_from_path
8585
*/
8686
public function test_get_language_files_from_path_caches_results() {
87-
$this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) . 'foobar/' );
88-
$this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) . 'plugins/' );
89-
$this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) . 'themes/' );
90-
$this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) );
91-
92-
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'plugins/' ), 'translations' ) );
93-
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'themes/' ), 'translations' ) );
94-
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'foobar/' ), 'translations' ) );
95-
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) ), 'translations' ) );
87+
$this->instance->get_language_files_from_path( WP_LANG_DIR . '/foobar/' );
88+
$this->instance->get_language_files_from_path( WP_LANG_DIR . '/plugins/' );
89+
$this->instance->get_language_files_from_path( WP_LANG_DIR . '/themes/' );
90+
$this->instance->get_language_files_from_path( WP_LANG_DIR . '/' );
91+
92+
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' ) );
93+
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' ) );
94+
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/foobar/' ), 'translations' ) );
95+
$this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' ) );
9696
}
9797

9898
/**
@@ -103,7 +103,7 @@ public function test_get_language_files_from_path_short_circuit() {
103103
$result = $this->instance->get_language_files_from_path( WP_LANG_DIR . '/plugins' );
104104
remove_filter( 'pre_get_language_files_from_path', '__return_empty_array' );
105105

106-
$cache = wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . 'plugins' ), 'translations' );
106+
$cache = wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins' ), 'translations' );
107107

108108
$this->assertEmpty( $result );
109109
$this->assertFalse( $cache );

0 commit comments

Comments
 (0)