mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
Rename ConsoleTest to ConsoleTestCase
This commit is contained in:
parent
9f8023b91f
commit
54ee36a6aa
5 changed files with 14 additions and 10 deletions
44
tests/ConsoleTestCase.php
Normal file
44
tests/ConsoleTestCase.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
// Copyright (C) 2010-2024, the Friendica project
|
||||
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
namespace Friendica\Test;
|
||||
|
||||
use Asika\SimpleConsole\Console;
|
||||
use Friendica\Test\MockedTestCase;
|
||||
use Friendica\Test\Util\Intercept;
|
||||
|
||||
abstract class ConsoleTestCase extends MockedTestCase
|
||||
{
|
||||
/**
|
||||
* @var array The default argv for a Console Instance
|
||||
*/
|
||||
protected $consoleArgv = [ 'consoleTest.php' ];
|
||||
|
||||
protected function setUp() : void
|
||||
{
|
||||
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 $console)
|
||||
{
|
||||
Intercept::reset();
|
||||
$console->execute();
|
||||
$returnStr = Intercept::$cache;
|
||||
Intercept::reset();
|
||||
|
||||
return $returnStr;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue