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