class PendingCommand (View source)
| Conditionable | |
| Macroable |
| static protected array | $macros | The registered string macros. | from Macroable |
| TestCase | $test | The test being run. | |
| protected Container | $app | The application instance. | |
| protected string | $command | The command to run. | |
| protected array | $parameters | The parameters to pass to the command. | |
| protected int | $expectedExitCode | The expected exit code. | |
| protected int | $unexpectedExitCode | The unexpected exit code. | |
| protected bool | $hasExecuted | Determine if the command has executed. |
| $this|TWhenReturnType | when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy. | from Conditionable |
| $this|TUnlessReturnType | unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy. | from Conditionable |
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| mixed | __call(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| void | __construct(TestCase $test, Container $app, string $command, array $parameters)
Create a new pending console command run. | |
| $this | expectsQuestion(string $question, string|bool $answer)
Specify an expected question that will be asked when the command runs. | |
| $this | expectsConfirmation(string $question, string $answer = 'no')
Specify an expected confirmation question that will be asked when the command runs. | |
| $this | expectsChoice(string $question, string|array $answer, array $answers, bool $strict = false)
Specify an expected choice question with expected answers that will be asked/shown when the command runs. | |
| $this | expectsOutput(string|null $output = null)
Specify output that should be printed when the command runs. | |
| $this | doesntExpectOutput(string|null $output = null)
Specify output that should never be printed when the command runs. | |
| $this | expectsOutputToContain(string $string)
Specify that the given string should be contained in the command output. | |
| $this | doesntExpectOutputToContain(string $string)
Specify that the given string shouldn't be contained in the command output. | |
| $this | expectsTable(array $headers, Arrayable|array $rows, string $tableStyle = 'default', array $columnStyles = [])
Specify a table that should be printed when the command runs. | |
| $this | assertExitCode(int $exitCode)
Assert that the command has the given exit code. | |
| $this | assertNotExitCode(int $exitCode)
Assert that the command does not have the given exit code. | |
| $this | assertSuccessful()
Assert that the command has the success exit code. | |
| $this | assertOk()
Assert that the command has the success exit code. | |
| $this | assertFailed()
Assert that the command does not have the success exit code. | |
| int | execute()
Execute the command. | |
| int | run()
Execute the command. | |
| void | verifyExpectations()
Determine if expected questions / choices / outputs are fulfilled. | |
| MockInterface | mockConsoleOutput()
Mock the application's console output. | |
| void | flushExpectations()
Flush the expectations from the test case. | |
| void | __destruct()
Handle the object's destruction. |
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Flush the existing macros.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new pending console command run.
Specify an expected question that will be asked when the command runs.
Specify an expected confirmation question that will be asked when the command runs.
Specify an expected choice question with expected answers that will be asked/shown when the command runs.
Specify output that should be printed when the command runs.
Specify output that should never be printed when the command runs.
Specify that the given string should be contained in the command output.
Specify that the given string shouldn't be contained in the command output.
Specify a table that should be printed when the command runs.
Assert that the command has the given exit code.
Assert that the command does not have the given exit code.
Assert that the command has the success exit code.
Assert that the command has the success exit code.
Assert that the command does not have the success exit code.
Execute the command.
Execute the command.
Determine if expected questions / choices / outputs are fulfilled.
Mock the application's console output.
Flush the expectations from the test case.
Handle the object's destruction.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Testing/PendingCommand.html