Skip to content

Commit ff870fd

Browse files
authored
Merge pull request #17 from pamil/variadic-arguments-not-only-ones
Add scenario for using variadic arguments together with regular ones
2 parents 2edce00 + 5017da7 commit ff870fd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

features/using_variadic_arguments_in_steps_definitions_with_named_parameters.feature

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ Feature: Using variadic arguments in steps definitions with named parameters
2626
{
2727
printf('Number of passed arguments: %d', count($arguments));
2828
}
29+
30+
/**
31+
* @When I pass :firstArgument and :secondArgument as arguments to :subject
32+
*/
33+
public function iPassToSubject($subject, ...$arguments)
34+
{
35+
printf('Number of arguments passed to %s: %d', $subject, count($arguments));
36+
}
2937
}
3038
"""
3139

@@ -50,3 +58,15 @@ Feature: Using variadic arguments in steps definitions with named parameters
5058
"""
5159
When I run Behat
5260
Then it should pass with "Number of passed arguments: 3"
61+
62+
Scenario: Using variadic arguments together with regular one
63+
Given a feature file "features/variadics_arguments_support.feature" containing:
64+
"""
65+
Feature: Passing two variadic arguments and one regular argument
66+
67+
Scenario: Passing two variadic arguments and one regular argument
68+
When I pass "foo" and "bar" as arguments to method
69+
70+
"""
71+
When I run Behat
72+
Then it should pass with "Number of arguments passed to method: 2"

0 commit comments

Comments
 (0)