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.
40 lines
753 B
40 lines
753 B
4 years ago
|
<?php
|
||
|
|
||
3 years ago
|
namespace Friendica\Test\src\Console;
|
||
4 years ago
|
|
||
4 years ago
|
use Asika\SimpleConsole\Console;
|
||
3 years ago
|
use Friendica\Test\MockedTest;
|
||
4 years ago
|
use Friendica\Test\Util\Intercept;
|
||
|
|
||
3 years ago
|
abstract class ConsoleTest extends MockedTest
|
||
4 years ago
|
{
|
||
4 years ago
|
/**
|
||
|
* @var array The default argv for a Console Instance
|
||
|
*/
|
||
|
protected $consoleArgv = [ 'consoleTest.php' ];
|
||
4 years ago
|
|
||
|
protected function setUp()
|
||
|
{
|
||
|
parent::setUp();
|
||
|
|
||
4 years ago
|
Intercept::setUp();
|
||
|
}
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* 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)
|
||
|
{
|
||
4 years ago
|
Intercept::reset();
|
||
4 years ago
|
$console->execute();
|
||
4 years ago
|
$returnStr = Intercept::$cache;
|
||
|
Intercept::reset();
|
||
4 years ago
|
|
||
4 years ago
|
return $returnStr;
|
||
4 years ago
|
}
|
||
4 years ago
|
}
|