Friendica Communications Platform
(please note that this is a clone of the repository at github, issues are handled there)
https://friendi.ca
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
753 B
39 lines
753 B
<?php |
|
|
|
namespace Friendica\Test\src\Console; |
|
|
|
use Asika\SimpleConsole\Console; |
|
use Friendica\Test\MockedTest; |
|
use Friendica\Test\Util\Intercept; |
|
|
|
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; |
|
} |
|
}
|
|
|