Skip to content

Commit 8ff8d85

Browse files
committed
Use array
1 parent 04f8fa5 commit 8ff8d85

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

bin/run-behat-tests

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,12 @@ if [[ "${WP_CLI_TEST_COVERAGE}" == "true" ]] && vendor/bin/behat --help 2>/dev/n
134134
fi
135135

136136
# Run the functional tests.
137-
FORMAT_SPECIFIED=false
137+
FORMAT_ARGS=(--format progress)
138138
for arg in "$@"; do
139139
if [[ "$arg" == "--format"* ]]; then
140-
FORMAT_SPECIFIED=true
140+
FORMAT_ARGS=()
141141
break
142142
fi
143143
done
144144

145-
if [ "$FORMAT_SPECIFIED" = true ]; then
146-
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"
147-
else
148-
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" --format progress "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"
149-
fi
145+
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" "${FORMAT_ARGS[@]}" "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"

0 commit comments

Comments
 (0)