Skip to content

Commit

Permalink
choices helper now has tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joetannenbaum committed May 16, 2023
1 parent d119d8a commit 732219d
Show file tree
Hide file tree
Showing 7 changed files with 762 additions and 5 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ $user = $this->termChoice(
fn($user) => $user->id,
),
);

// Defaults will be determined by the display value when no return value is specified
$user = $this->termChoice(
question: 'Which user would you like to edit?',
choices: Choices::from($users, 'name'),
default: 'Joe',
);

// Defaults will be determined by the return value if it is specified
$user = $this->termChoice(
question: 'Which user would you like to edit?',
choices: Choices::from($users, 'name', 'id'),
default: 123,
);
```

### `termConfirm`
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"require-dev": {
"tightenco/duster": "^2.0",
"pestphp/pest": "^2.6",
"mockery/mockery": "^1.5"
"mockery/mockery": "^1.5",
"spatie/ray": "^1.37"
},
"license": "MIT",
"autoload": {
Expand Down
Loading

0 comments on commit 732219d

Please sign in to comment.