Skip to content

Commit a770faf

Browse files
Copilotswissspidy
andcommitted
Add test for themes with text domain different from slug
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 6e2d8b7 commit a770faf

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

features/language-theme.feature

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,33 @@ Feature: Manage theme translation files for a WordPress install
328328
| en_US | active |
329329
| nl_NL | installed |
330330
And STDERR should be empty
331+
332+
@require-wp-4.0
333+
Scenario: Handle themes with text domain different from slug
334+
Given a WP install
335+
And an empty cache
336+
337+
# Create a test theme with a different text domain
338+
Given a wp-content/themes/test-theme/style.css file:
339+
"""
340+
/*
341+
Theme Name: Test Theme
342+
Text Domain: different-text-domain
343+
*/
344+
"""
345+
346+
# Manually create a translation file using the text domain (not the theme slug)
347+
And a wp-content/languages/themes/different-text-domain-de_DE.l10n.php file:
348+
"""
349+
"""
350+
351+
When I run `wp language theme list test-theme --fields=language,status --format=csv`
352+
Then STDOUT should contain:
353+
"""
354+
en_US,active
355+
"""
356+
And STDERR should be empty
357+
358+
# If the fix is working, installed languages should be detected via text domain
359+
When I run `wp language theme is-installed test-theme de_DE`
360+
Then the return code should be 0

0 commit comments

Comments
 (0)