AbstractQuestionHelperTest.php 927 B

1234567891011121314151617181920212223242526272829303132333435
  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 PHPUnit\Framework\TestCase;
  12. use Symfony\Component\Console\Input\StreamableInputInterface;
  13. abstract class AbstractQuestionHelperTest extends TestCase
  14. {
  15. protected function createStreamableInputInterfaceMock($stream = null, $interactive = true)
  16. {
  17. $mock = $this->getMockBuilder(StreamableInputInterface::class)->getMock();
  18. $mock->expects($this->any())
  19. ->method('isInteractive')
  20. ->willReturn($interactive);
  21. if ($stream) {
  22. $mock->expects($this->any())
  23. ->method('getStream')
  24. ->willReturn($stream);
  25. }
  26. return $mock;
  27. }
  28. }