Skip to content

Commit

Permalink
Document create:test command
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers authored Dec 28, 2023
1 parent f9b5692 commit 6849a2f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions console/scaffolding.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,20 @@ php artisan create:command <plugin code> <command name>
```

The `create:command` command generates a [new console command](../console/introduction#building-a-command). The first argument specifies the plugin code of the plugin that this console command will be added into, and the second parameter specifies the command name.

## Create a test

```bash
php artisan create:test <plugin code> <path to class to be tested or test name>
```

The `create:test` command generates a test case. The first argument specifies the plugin code of the plugin that this job will be added into, and the second specifies the relative path to the class to be tested (i.e. a test for `\MyAuthor\MyPlugin\Classes\AuthManager` could be generated by calling `php artisan create:test myauthor.myplugin Classes\\AuthManager`) or the test's name (eg. `AuthManager`, which would be automatically expanded to `AuthManagerTest`).

The following options are supported:

short | long | description
----- | ---- | -----------
`-u` | `--unit` | Generates a Unit test (defaults to generating Feature tests)
`-p` | `--pest` | Generates a Pest PHP test (defaults to generating PHPUnit tests)
`-f` | `--force` | Overwrites existing files with generated files
n/a | `--uninspiring` | Disables inspirational quotes

0 comments on commit 6849a2f

Please sign in to comment.