diff options
author | diosmosis <benaka@piwik.pro> | 2015-05-11 10:40:04 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-06-11 09:42:04 +0300 |
commit | 5a2ac9fadfa9f6004821651b0173a9973ebe0623 (patch) | |
tree | b1ad3921b8aaf171c84d200aa05d3ed59fe24b4b /tests/PHPUnit/Framework/TestCase | |
parent | 349f234d77e98d009e717ddf1137cb064bcc728e (diff) |
Adding integration test for logs:delete command. Includes fix to symfony issue w/ using mock interactive input streams. If the posix_isatty function exists, the interactive flag set by ApplicationTester will be overridden by Application::configureIO.
Diffstat (limited to 'tests/PHPUnit/Framework/TestCase')
-rw-r--r-- | tests/PHPUnit/Framework/TestCase/ConsoleCommandTestCase.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/PHPUnit/Framework/TestCase/ConsoleCommandTestCase.php b/tests/PHPUnit/Framework/TestCase/ConsoleCommandTestCase.php index 2da07556e1..0cd53f947e 100644 --- a/tests/PHPUnit/Framework/TestCase/ConsoleCommandTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/ConsoleCommandTestCase.php @@ -10,8 +10,22 @@ namespace Piwik\Tests\Framework\TestCase; use Piwik\Console; use Symfony\Component\Console\Application; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\ApplicationTester; +class TestConsole extends Console +{ + protected function configureIO(InputInterface $input, OutputInterface $output) + { + $isInteractive = $input->isInteractive(); + + parent::configureIO($input, $output); + + $input->setInteractive($isInteractive); + } +} + /** * Base class for test cases that test Piwik console commands. Derives from SystemTestCase * so the entire Piwik environment is set up. @@ -51,7 +65,7 @@ class ConsoleCommandTestCase extends SystemTestCase { parent::setUp(); - $this->application = new Console(); + $this->application = new TestConsole(); $this->application->setAutoExit(false); $this->applicationTester = new ApplicationTester($this->application); |