Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions features/makepot.feature
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,9 @@ Feature: Generate a POT file of a WordPress project
Plugin Description
"""

@skip-windows
Scenario: Adds copyright comments
When I run `wp scaffold plugin hello-world`
And I run `date +"%Y"`
Then STDOUT should not be empty
And save STDOUT as {YEAR}

When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
"""
# Copyright (C) {YEAR} YOUR NAME HERE
# This file is distributed under the same license as the Hello World plugin.
"""

@require-windows
Scenario: Adds copyright comments
When I run `wp scaffold plugin hello-world`
And I run `get-date -f yyyy`
And I run `php -r "echo date('Y');"`
Then STDOUT should not be empty
And save STDOUT as {YEAR}

Expand Down Expand Up @@ -593,7 +578,7 @@ Feature: Generate a POT file of a WordPress project
"""

Scenario: Extract translator comments
Given I run `echo "\t"`
Given I run `php -r "echo \"\t\";"`
And save STDOUT as {TAB}
And an empty foo-plugin directory
And a foo-plugin/foo-plugin.php file:
Expand Down Expand Up @@ -1185,6 +1170,12 @@ Feature: Generate a POT file of a WordPress project
I am not being ignored either
"""

# Skipped on Windows because the `--exclude="/myvendor/,/ignored.php"` argument
# relies on forward-slash path matching, which does not behave as expected with
# Windows backslash directory separators. On Windows, `foo-plugin/myvendor/foo.php`
# and `foo-plugin/ignored.php` are not excluded correctly and their strings still
# appear in the generated POT file, causing this scenario's assertions to fail.
@skip-windows
Scenario: Removes trailing and leading slashes of excluded paths
Given an empty foo-plugin directory
And a foo-plugin/foo-plugin.php file:
Expand Down Expand Up @@ -2654,7 +2645,7 @@ Feature: Generate a POT file of a WordPress project
__( 'Hello World', 'foo-plugin' );
"""

When I run `wp eval "echo DIRECTORY_SEPARATOR;"`
When I run `php -r "echo DIRECTORY_SEPARATOR;"`
And save STDOUT as {DIRECTORY_SEPARATOR}

And I try `wp i18n make-pot foo-plugin --debug`
Expand Down Expand Up @@ -2727,7 +2718,7 @@ Feature: Generate a POT file of a WordPress project
*/
"""

When I run `wp eval "echo DIRECTORY_SEPARATOR;"`
When I run `php -r "echo DIRECTORY_SEPARATOR;"`
And save STDOUT as {DIRECTORY_SEPARATOR}

And I try `wp i18n make-pot foo-theme --debug`
Expand Down