From 9d7bc5111f5c75b9f2550f50a0d141513aa3aeee Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 16 Jan 2024 21:32:21 +0000 Subject: [PATCH] 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 --- .../tests/l10n/wpTextdomainRegistry.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/tests/l10n/wpTextdomainRegistry.php b/tests/phpunit/tests/l10n/wpTextdomainRegistry.php index 6b117b5f50..8334c4ea2e 100644 --- a/tests/phpunit/tests/l10n/wpTextdomainRegistry.php +++ b/tests/phpunit/tests/l10n/wpTextdomainRegistry.php @@ -49,7 +49,7 @@ class Tests_L10n_wpTextdomainRegistry extends WP_UnitTestCase { 'Custom path for textdomain not returned' ); $this->assertNotFalse( - wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'bar/' ), 'translations' ), + wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/bar/' ), 'translations' ), 'List of files in custom path not cached' ); } @@ -84,15 +84,15 @@ class Tests_L10n_wpTextdomainRegistry extends WP_UnitTestCase { * @covers ::get_language_files_from_path */ public function test_get_language_files_from_path_caches_results() { - $this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) . 'foobar/' ); - $this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) . 'plugins/' ); - $this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) . 'themes/' ); - $this->instance->get_language_files_from_path( trailingslashit( WP_LANG_DIR ) ); + $this->instance->get_language_files_from_path( WP_LANG_DIR . '/foobar/' ); + $this->instance->get_language_files_from_path( WP_LANG_DIR . '/plugins/' ); + $this->instance->get_language_files_from_path( WP_LANG_DIR . '/themes/' ); + $this->instance->get_language_files_from_path( WP_LANG_DIR . '/' ); - $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'plugins/' ), 'translations' ) ); - $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'themes/' ), 'translations' ) ); - $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) . 'foobar/' ), 'translations' ) ); - $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( trailingslashit( WP_LANG_DIR ) ), 'translations' ) ); + $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' ) ); + $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' ) ); + $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/foobar/' ), 'translations' ) ); + $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' ) ); } /** @@ -103,7 +103,7 @@ class Tests_L10n_wpTextdomainRegistry extends WP_UnitTestCase { $result = $this->instance->get_language_files_from_path( WP_LANG_DIR . '/plugins' ); remove_filter( 'pre_get_language_files_from_path', '__return_empty_array' ); - $cache = wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . 'plugins' ), 'translations' ); + $cache = wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins' ), 'translations' ); $this->assertEmpty( $result ); $this->assertFalse( $cache );