3 namespace Friendica\Test\src\Core\Console;
5 use Asika\SimpleConsole\Console;
6 use Friendica\Core\Config\ConfigCache;
7 use Friendica\Test\MockedTest;
8 use Friendica\Test\Util\AppMockTrait;
9 use Friendica\Test\Util\Intercept;
10 use Friendica\Test\Util\VFSTrait;
11 use Friendica\Util\Profiler;
13 abstract class ConsoleTest extends MockedTest
19 * @var array The default argv for a Console Instance
21 protected $consoleArgv = [ 'consoleTest.php' ];
23 protected function setUp()
27 if (!getenv('MYSQL_DATABASE')) {
28 $this->markTestSkipped('Please set the MYSQL_* environment variables to your test database credentials.');
34 $configMock = \Mockery::mock(ConfigCache::class);
35 $this->mockApp($this->root, $configMock);
36 $profileMock = \Mockery::mock(Profiler::class);
37 $this->app->shouldReceive('getProfiler')->andReturn($profileMock);
41 * Dumps the execution of an console output to a string and returns it
43 * @param Console $console The current console instance
45 * @return string the output of the execution
47 protected function dumpExecute($console)
51 $returnStr = Intercept::$cache;