AbstractQuestionHelperTest.php 928 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Console\Tests\Helper;
  11. use Symfony\Component\Console\Input\StreamableInputInterface;
  12. abstract class AbstractQuestionHelperTest extends \PHPUnit_Framework_TestCase
  13. {
  14. protected function createStreamableInputInterfaceMock($stream = null, $interactive = true)
  15. {
  16. $mock = $this->getMockBuilder(StreamableInputInterface::class)->getMock();
  17. $mock->expects($this->any())
  18. ->method('isInteractive')
  19. ->will($this->returnValue($interactive));
  20. if ($stream) {
  21. $mock->expects($this->any())
  22. ->method('getStream')
  23. ->willReturn($stream);
  24. }
  25. return $mock;
  26. }
  27. }