PluginProbe
Depicter — Popup & Slider Builder / 1.3.3
Depicter — Popup & Slider Builder v1.3.3
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / vendor / symfony / console / Tester / ApplicationTester.php

ApplicationTester.php in Depicter — Popup & Slider Builder 1.3.3, at vendor/symfony/console/Tester/ApplicationTester.php

68 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Console\Tester;
13
14 use Symfony\Component\Console\Application;
15 use Symfony\Component\Console\Input\ArrayInput;
16
17 /**
18 * Eases the testing of console applications.
19 *
20 * When testing an application, don't forget to disable the auto exit flag:
21 *
22 * $application = new Application();
23 * $application->setAutoExit(false);
24 *
25 * @author Fabien Potencier <fabien@symfony.com>
26 */
27 class ApplicationTester
28 {
29 use TesterTrait;
30
31 private $application;
32 private $input;
33 private $statusCode;
34
35 public function __construct(Application $application)
36 {
37 $this->application = $application;
38 }
39
40 /**
41 * Executes the application.
42 *
43 * Available options:
44 *
45 * * interactive: Sets the input interactive flag
46 * * decorated: Sets the output decorated flag
47 * * verbosity: Sets the output verbosity flag
48 * * capture_stderr_separately: Make output of stdOut and stdErr separately available
49 *
50 * @return int The command exit code
51 */
52 public function run(array $input, array $options = [])
53 {
54 $this->input = new ArrayInput($input);
55 if (isset($options['interactive'])) {
56 $this->input->setInteractive($options['interactive']);
57 }
58
59 if ($this->inputs) {
60 $this->input->setStream(self::createStream($this->inputs));
61 }
62
63 $this->initOutput($options);
64
65 return $this->statusCode = $this->application->run($this->input, $this->output);
66 }
67 }
68