MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
CommandTester.php
Ir para a documentação deste ficheiro.
1
<?php
2
3
namespace
Symfony\Component\Console\Tester
;
4
5
use
Symfony\Component\Console\Command\Command
;
6
use
Symfony\Component\Console\Input\ArrayInput
;
7
use
Symfony\Component\Console\Output\StreamOutput
;
8
9
/*
10
* This file is part of the Symfony framework.
11
*
12
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
13
*
14
* This source file is subject to the MIT license that is bundled
15
* with this source code in the file LICENSE.
16
*/
17
21
class
CommandTester
22
{
23
protected
$command
;
24
protected
$display
;
25
protected
$input
;
26
protected
$output
;
27
33
public
function
__construct
(
Command
$command
)
34
{
35
$this->command =
$command
;
36
}
37
50
public
function
execute
(array
$input
, array $options = array())
51
{
52
$this->input =
new
ArrayInput
(
$input
);
53
if
(isset($options[
'interactive'
])) {
54
$this->input->setInteractive($options[
'interactive'
]);
55
}
56
57
$this->output =
new
StreamOutput
(fopen(
'php://memory'
,
'w'
,
false
));
58
if
(isset($options[
'decorated'
])) {
59
$this->output->setDecorated($options[
'decorated'
]);
60
}
61
if
(isset($options[
'verbosity'
])) {
62
$this->output->setVerbosity($options[
'verbosity'
]);
63
}
64
65
$ret = $this->command->run($this->input, $this->output);
66
67
rewind($this->output->getStream());
68
69
return
$this->display = stream_get_contents($this->output->getStream());
70
}
71
77
public
function
getDisplay
()
78
{
79
return
$this->display
;
80
}
81
87
public
function
getInput
()
88
{
89
return
$this->input
;
90
}
91
97
public
function
getOutput
()
98
{
99
return
$this->output
;
100
}
101
}
Symfony\Component\Console\Command\Command
Definição
Command.php:27
Symfony\Component\Console\Input\ArrayInput
Definição
ArrayInput.php:24
Symfony\Component\Console\Output\StreamOutput
Definição
StreamOutput.php:28
Symfony\Component\Console\Tester\CommandTester
Definição
CommandTester.php:22
Symfony\Component\Console\Tester\CommandTester\__construct
__construct(Command $command)
Definição
CommandTester.php:33
Symfony\Component\Console\Tester\CommandTester\execute
execute(array $input, array $options=array())
Definição
CommandTester.php:50
Symfony\Component\Console\Tester\CommandTester\getInput
getInput()
Definição
CommandTester.php:87
Symfony\Component\Console\Tester\CommandTester\$input
$input
Definição
CommandTester.php:25
Symfony\Component\Console\Tester\CommandTester\$output
$output
Definição
CommandTester.php:26
Symfony\Component\Console\Tester\CommandTester\getDisplay
getDisplay()
Definição
CommandTester.php:77
Symfony\Component\Console\Tester\CommandTester\$command
$command
Definição
CommandTester.php:23
Symfony\Component\Console\Tester\CommandTester\$display
$display
Definição
CommandTester.php:24
Symfony\Component\Console\Tester\CommandTester\getOutput
getOutput()
Definição
CommandTester.php:97
Symfony\Component\Console\Tester
Definição
ApplicationTester.php:3
classes
extensions
doctrine-dbal
Doctrine
Symfony
Component
Console
Tester
CommandTester.php
Gerado por
1.10.0