* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development */ namespace VuFindTest\Harvest\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; use VuFindHarvest\ConsoleOutput\ConsoleWriter; use VuFindHarvest\ConsoleOutput\WriterAwareTrait; /** * Console writer test * * @category VuFind * @package Tests * @author Demian Katz * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development */ class ConsoleWriterTest extends \PHPUnit\Framework\TestCase { use WriterAwareTrait; /** * Test console writer * * @return void */ public function testWriter() { $mockOutput = $this->getMockBuilder(OutputInterface::class) ->disableOriginalConstructor() ->getMock(); $mockOutput->expects($this->once())->method('write') ->with($this->equalTo('writeTest')); $mockOutput->expects($this->once())->method('writeln') ->with($this->equalTo('writelnTest')); $this->setOutputWriter(new ConsoleWriter($mockOutput)); $this->write('writeTest'); $this->writeLine('writelnTest'); } }