Skip to content

Commit 8f2d89c

Browse files
committed
Update unit tests.
1 parent 208f623 commit 8f2d89c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

includes/core/classes/class-topic.php

+2
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ public static function get_localized_taxonomy_slug(): string {
135135
$switched_locale = switch_to_locale( get_locale() );
136136
$slug = _x( 'Topic', 'Admin menu and taxonomy singular name', 'gatherpress' );
137137
$slug = sanitize_title( $slug );
138+
138139
if ( $switched_locale ) {
139140
restore_previous_locale();
140141
}
142+
141143
return $slug;
142144
}
143145
}

test/unit/php/includes/core/classes/class-test-topic.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ public function test_get_localized_taxonomy_slug(): void {
9696
// Restore default locale for following tests.
9797
switch_to_locale( 'en_US' );
9898

99-
// This also checks that the taxonomy is still registered with the same 'Taxonomy Singular Name' label,
99+
// This also checks that the taxonomy is still registered with the same 'Admin menu and taxonomy singular name' label,
100100
// which is used by the method under test and the test itself.
101101
$filter = static function ( string $translation, string $text, string $context ): string {
102-
if ( 'Topic' !== $text || 'Taxonomy Singular Name' !== $context ) {
102+
if ( 'Topic' !== $text || 'Admin menu and taxonomy singular name' !== $context ) {
103103
return $translation;
104104
}
105105
return 'Ünit Tést';

test/unit/php/includes/core/classes/class-test-venue.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ public function test_get_localized_post_type_slug(): void {
126126
// Restore default locale for following tests.
127127
switch_to_locale( 'en_US' );
128128

129-
// This also checks that the post type is still registered with the same 'Post Type Singular Name' label,
129+
// This also checks that the post type is still registered with the same 'Admin menu and post type singular name' label,
130130
// which is used by the method under test and the test itself.
131131
$filter = static function ( string $translation, string $text, string $context ): string {
132-
if ( 'Venue' !== $text || 'Post Type Singular Name' !== $context ) {
132+
if ( 'Venue' !== $text || 'Admin menu and post type singular name' !== $context ) {
133133
return $translation;
134134
}
135135
return 'Ünit Tést';

0 commit comments

Comments
 (0)