File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,22 @@ Feature: Evaluating PHP code and files.
3838 #!
3939 """
4040
41+ Scenario : Has access to associative args
42+ Given a WP installation
43+ And a wp-cli.yml file:
44+ """
45+ eval:
46+ foo: bar
47+ post list:
48+ format: count
49+ """
50+
51+ When I run `wp eval 'echo json_encode( $assoc_args );' `
52+ Then STDOUT should be JSON containing:
53+ """
54+ {"foo": "bar"}
55+ """
56+
4157 Scenario : Eval without WordPress install
4258 Given an empty directory
4359
Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ class Eval_Command extends WP_CLI_Command {
3939 */
4040 public function __invoke ( $ args , $ assoc_args ) {
4141
42- $ execute_closure = function () use ( $ args ) {
42+ // @phpstan-ignore closure.unusedUse
43+ $ execute_closure = function () use ( $ args , $ assoc_args ) {
4344 eval ( $ args [0 ] );
4445 };
4546
You can’t perform that action at this time.
0 commit comments