]> git.mxchange.org Git - friendica.git/commitdiff
Rename ConsoleTest to ConsoleTestCase
authorArt4 <art4@wlabs.de>
Sat, 14 Dec 2024 08:16:37 +0000 (08:16 +0000)
committerArt4 <art4@wlabs.de>
Sat, 14 Dec 2024 08:16:37 +0000 (08:16 +0000)
tests/ConsoleTestCase.php [new file with mode: 0644]
tests/src/Console/AutomaticInstallationConsoleTest.php
tests/src/Console/ConfigConsoleTest.php
tests/src/Console/ConsoleTest.php [deleted file]
tests/src/Console/LockConsoleTest.php
tests/src/Console/ServerBlockConsoleTest.php

diff --git a/tests/ConsoleTestCase.php b/tests/ConsoleTestCase.php
new file mode 100644 (file)
index 0000000..05febcd
--- /dev/null
@@ -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;
+       }
+}
index c5d466eb111e0349745a8c67c16d85ee6cc4ea7b..0c2ffe1072da9bd7f6c6d766790ef936380c5355 100644 (file)
@@ -16,6 +16,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Database\Database;
 use Friendica\DI;
+use Friendica\Test\ConsoleTestCase;
 use Friendica\Test\Util\RendererMockTrait;
 use Friendica\Test\Util\VFSTrait;
 use Mockery;
@@ -24,7 +25,7 @@ use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamFile;
 use Psr\Log\NullLogger;
 
-class AutomaticInstallationConsoleTest extends ConsoleTest
+class AutomaticInstallationConsoleTest extends ConsoleTestCase
 {
        use VFSTrait;
        use RendererMockTrait;
@@ -273,7 +274,7 @@ Creating config file...
 Checking database...
 
 [Error] --------
-Could not connect to database.: 
+Could not connect to database.:
 
 
 FIN;
@@ -633,12 +634,12 @@ Options
     -d|--dbdata <database>    The name of the mysql/mariadb database (env MYSQL_DATABASE)
     -U|--dbuser <username>    The username of the mysql/mariadb database login (env MYSQL_USER or MYSQL_USERNAME)
     -P|--dbpass <password>    The password of the mysql/mariadb database login (env MYSQL_PASSWORD)
-    -U|--url <url>            The full base URL of Friendica - f.e. 'https://friendica.local/sub' (env FRIENDICA_URL) 
+    -U|--url <url>            The full base URL of Friendica - f.e. 'https://friendica.local/sub' (env FRIENDICA_URL)
     -B|--phppath <php_path>   The path of the PHP binary (env FRIENDICA_PHP_PATH)
     -b|--basepath <base_path> The basepath of Friendica (env FRIENDICA_BASE_PATH)
     -t|--tz <timezone>        The timezone of Friendica (env FRIENDICA_TZ)
     -L|--lang <language>      The language of Friendica (env FRIENDICA_LANG)
+
 Environment variables
    MYSQL_HOST                  The host of the mysql/mariadb database (mandatory if mysql and environment is used)
    MYSQL_PORT                  The port of the mysql/mariadb database
@@ -651,7 +652,7 @@ Environment variables
    FRIENDICA_ADMIN_MAIL        The admin email address of Friendica (this email will be used for admin access)
    FRIENDICA_TZ                The timezone of Friendica
    FRIENDICA_LANG              The langauge of Friendica
-   
+
 Examples
        bin/console autoinstall -f 'input.config.php
                Installs Friendica with the prepared 'input.config.php' file
index efcfd1fb1f09d7b101757bacecbb5a945ea7c85d..3c983e04afe401bf31fbe7d41c12d8e4ae06be84 100644 (file)
@@ -11,11 +11,12 @@ use Friendica\App;
 use Friendica\App\Mode;
 use Friendica\Console\Config;
 use Friendica\Core\Config\Capability\IManageConfigValues;
+use Friendica\Test\ConsoleTestCase;
 use Mockery;
 use Mockery\LegacyMockInterface;
 use Mockery\MockInterface;
 
-class ConfigConsoleTest extends ConsoleTest
+class ConfigConsoleTest extends ConsoleTestCase
 {
        /**
         * @var App\Mode|MockInterface $appMode
diff --git a/tests/src/Console/ConsoleTest.php b/tests/src/Console/ConsoleTest.php
deleted file mode 100644 (file)
index 5384076..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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\src\Console;
-
-use Asika\SimpleConsole\Console;
-use Friendica\Test\MockedTestCase;
-use Friendica\Test\Util\Intercept;
-
-abstract class ConsoleTest 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;
-       }
-}
index 17fda1150b7d740688022705b1e61f4d8a0a7cfb..d059de696ff355242a81b2847ce850fc6cf014a0 100644 (file)
@@ -11,10 +11,11 @@ use Friendica\App;
 use Friendica\App\Mode;
 use Friendica\Console\Lock;
 use Friendica\Core\Lock\Capability\ICanLock;
+use Friendica\Test\ConsoleTestCase;
 use Mockery;
 use Mockery\MockInterface;
 
-class LockConsoleTest extends ConsoleTest
+class LockConsoleTest extends ConsoleTestCase
 {
        /**
         * @var App\Mode|MockInterface $appMode
index 121e071e2a92e5d23f56a596738f7edcd2cfc259..cbbb8bdb39c433fedc5ff658165c6c3005ec0e72 100644 (file)
@@ -9,10 +9,11 @@ namespace Friendica\Test\src\Console;
 
 use Friendica\Console\ServerBlock;
 use Friendica\Moderation\DomainPatternBlocklist;
+use Friendica\Test\ConsoleTestCase;
 use Friendica\Test\FixtureTestTrait;
 use Mockery;
 
-class ServerBlockConsoleTest extends ConsoleTest
+class ServerBlockConsoleTest extends ConsoleTestCase
 {
        use FixtureTestTrait;