Skip to content

Commit

Permalink
Add tests for domain argument
Browse files Browse the repository at this point in the history
See #7.
  • Loading branch information
swissspidy committed Dec 20, 2017
1 parent e7ed770 commit efa09ac
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions features/makepot-plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,42 @@ Feature: Generate a POT file of a WordPress plugin
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"""

Scenario: Ignores any other text domain
Given an empty foo-plugin directory
And a foo-plugin/foo-plugin.php file:
"""
<?php
/**
* Plugin Name: Foo Plugin
* Plugin URI: https://example.com
* Description:
* Version: 0.1.0
* Author:
* Author URI:
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: foo-plugin
* Domain Path: /languages
*/
__( 'Hello World', 'foo-plugin' );
__( 'Foo', 'bar' );
__( 'bar' );
"""

When I run `wp makepot plugin foo-plugin foo-plugin.pot`
And the foo-plugin.pot file should contain:
"""
msgid "Hello World"
"""
And the foo-plugin.pot file should not contain:
"""
msgid "Foo"
"""
And the foo-plugin.pot file should not contain:
"""
msgid "bar"
"""

0 comments on commit efa09ac

Please sign in to comment.