190 lines
3.9 KiB
YAML
190 lines
3.9 KiB
YAML
|
name: FakeProcessResult
|
||
|
class_comment: null
|
||
|
dependencies:
|
||
|
- name: ProcessResultContract
|
||
|
type: class
|
||
|
source: Illuminate\Contracts\Process\ProcessResult
|
||
|
- name: ProcessFailedException
|
||
|
type: class
|
||
|
source: Illuminate\Process\Exceptions\ProcessFailedException
|
||
|
properties:
|
||
|
- name: command
|
||
|
visibility: protected
|
||
|
comment: '# * The command string.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var string'
|
||
|
- name: exitCode
|
||
|
visibility: protected
|
||
|
comment: '# * The process exit code.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var int'
|
||
|
- name: output
|
||
|
visibility: protected
|
||
|
comment: '# * The process output.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var string'
|
||
|
- name: errorOutput
|
||
|
visibility: protected
|
||
|
comment: '# * The process error output.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var string'
|
||
|
methods:
|
||
|
- name: __construct
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: command
|
||
|
default: ''''''
|
||
|
- name: exitCode
|
||
|
default: '0'
|
||
|
- name: output
|
||
|
default: ''''''
|
||
|
- name: errorOutput
|
||
|
default: ''''''
|
||
|
comment: "# * The command string.\n# *\n# * @var string\n# */\n# protected $command;\n\
|
||
|
# \n# /**\n# * The process exit code.\n# *\n# * @var int\n# */\n# protected $exitCode;\n\
|
||
|
# \n# /**\n# * The process output.\n# *\n# * @var string\n# */\n# protected $output\
|
||
|
\ = '';\n# \n# /**\n# * The process error output.\n# *\n# * @var string\n# */\n\
|
||
|
# protected $errorOutput = '';\n# \n# /**\n# * Create a new process result instance.\n\
|
||
|
# *\n# * @param string $command\n# * @param int $exitCode\n# * @param array|string\
|
||
|
\ $output\n# * @param array|string $errorOutput\n# * @return void"
|
||
|
- name: normalizeOutput
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: output
|
||
|
comment: '# * Normalize the given output into a string with newlines.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array|string $output
|
||
|
|
||
|
# * @return string'
|
||
|
- name: command
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Get the original command executed by the process.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return string'
|
||
|
- name: withCommand
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: command
|
||
|
comment: '# * Create a new fake process result with the given command.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $command
|
||
|
|
||
|
# * @return self'
|
||
|
- name: successful
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Determine if the process was successful.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return bool'
|
||
|
- name: failed
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Determine if the process failed.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return bool'
|
||
|
- name: exitCode
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Get the exit code of the process.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return int'
|
||
|
- name: output
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Get the standard output of the process.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return string'
|
||
|
- name: seeInOutput
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: output
|
||
|
comment: '# * Determine if the output contains the given string.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $output
|
||
|
|
||
|
# * @return bool'
|
||
|
- name: errorOutput
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Get the error output of the process.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return string'
|
||
|
- name: seeInErrorOutput
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: output
|
||
|
comment: '# * Determine if the error output contains the given string.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $output
|
||
|
|
||
|
# * @return bool'
|
||
|
- name: throw
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: callback
|
||
|
default: 'null'
|
||
|
comment: '# * Throw an exception if the process failed.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param callable|null $callback
|
||
|
|
||
|
# * @return $this
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws \Illuminate\Process\Exceptions\ProcessFailedException'
|
||
|
- name: throwIf
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: condition
|
||
|
- name: callback
|
||
|
default: 'null'
|
||
|
comment: '# * Throw an exception if the process failed and the given condition is
|
||
|
true.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param bool $condition
|
||
|
|
||
|
# * @param callable|null $callback
|
||
|
|
||
|
# * @return $this
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws \Throwable'
|
||
|
traits:
|
||
|
- Illuminate\Process\Exceptions\ProcessFailedException
|
||
|
interfaces:
|
||
|
- ProcessResultContract
|