mirror of
https://github.com/friendica/friendica
synced 2024-06-22 23:59:24 +02:00
a60eb9e33d
- Use Friendica\Core\Console as Controller for DI-library - Refactor every console command to use DICE (when possible) - Adjusting tests
40 lines
753 B
PHP
40 lines
753 B
PHP
<?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;
|
|
}
|
|
}
|