Skip to content

Commit

Permalink
Add behat test
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Apr 6, 2022
1 parent 29c3b19 commit fe3b26d
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions features/makepot.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3658,3 +3658,41 @@ Feature: Generate a POT file of a WordPress project
msgctxt "Color name"
msgid "Black"
"""

@patterns
Scenario: Extract strings from the patterns directory
Given an empty foo-theme/patterns directory
And a foo-theme/patterns/my-pattern.php file:
"""
<?php
/**
* Title: My pattern title.
* Description: My pattern description.
*/
"""
And a foo-theme/style.css file:
"""
/*
Theme Name: foo theme
*/
"""

When I try `wp i18n make-pot foo-theme`
Then STDOUT should be:
"""
Theme stylesheet detected.
Success: POT file successfully generated!
"""
And the foo-theme/foo-theme.pot file should exist
And the foo-theme/foo-theme.pot file should contain:
"""
#: patterns/my-pattern.php
msgctxt "Pattern title"
msgid "My pattern title."
msgstr ""
#: patterns/my-pattern.php
msgctxt "Pattern description"
msgid "My pattern description."
msgstr ""
"""

0 comments on commit fe3b26d

Please sign in to comment.