friendica/tests/src/Console/ConsoleTest.php

40 lines
753 B
PHP
Raw Normal View History

<?php
2019-05-02 17:17:35 -04:00
namespace Friendica\Test\src\Console;
use Asika\SimpleConsole\Console;
2019-02-02 13:21:48 -05:00
use Friendica\Test\MockedTest;
use Friendica\Test\Util\Intercept;
2019-02-02 13:21:48 -05:00
abstract class ConsoleTest extends MockedTest
{
/**
* @var array The default argv for a Console Instance
*/
protected $consoleArgv = [ 'consoleTest.php' ];
protected function setUp()
{
parent::setUp();
Intercept::setUp();
}
/**
* Dumps the execution of an console output to a string and returns it
*
* @param Console $console The current console instance
*
* @return string the output of the execution
*/
protected function dumpExecute($console)
{
Intercept::reset();
$console->execute();
$returnStr = Intercept::$cache;
Intercept::reset();
return $returnStr;
}
}