From afa8443949d3bfe11bde5d0d6cae5b2f167ca280 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 7 Mar 2022 00:31:02 +0000 Subject: [PATCH] [TESTS] Fix some failing tests broken by restructuring and dependency updates --- {tests/Controller => components/Feed/tests}/FeedsTest.php | 2 +- .../Person/tests/PersonSettingsTest.php | 4 ++-- composer.json | 3 ++- config/services.yaml | 4 ++-- tests/Controller/SecurityTest.php | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) rename {tests/Controller => components/Feed/tests}/FeedsTest.php (98%) rename tests/Controller/UserPanelTest.php => components/Person/tests/PersonSettingsTest.php (98%) diff --git a/tests/Controller/FeedsTest.php b/components/Feed/tests/FeedsTest.php similarity index 98% rename from tests/Controller/FeedsTest.php rename to components/Feed/tests/FeedsTest.php index e1cc06e646..e230c4faa1 100644 --- a/tests/Controller/FeedsTest.php +++ b/components/Feed/tests/FeedsTest.php @@ -21,7 +21,7 @@ declare(strict_types = 1); // }}} -namespace App\Tests\Controller; +namespace Component\Feed\Tests\Controller; use App\Core\DB\DB; use App\Core\Security; diff --git a/tests/Controller/UserPanelTest.php b/components/Person/tests/PersonSettingsTest.php similarity index 98% rename from tests/Controller/UserPanelTest.php rename to components/Person/tests/PersonSettingsTest.php index fb09d9bb2c..5ecee1a2b6 100644 --- a/tests/Controller/UserPanelTest.php +++ b/components/Person/tests/PersonSettingsTest.php @@ -21,14 +21,14 @@ declare(strict_types = 1); // }}} -namespace App\Tests\Controller; +namespace Component\Person\Tests; use App\Core\DB\DB; use App\Util\GNUsocialTestCase; use Functional as F; use Jchook\AssertThrows\AssertThrows; -class UserPanelTest extends GNUsocialTestCase +class PersonSettingsTest extends GNUsocialTestCase { use AssertThrows; diff --git a/composer.json b/composer.json index 2fc017cc49..af412b607b 100644 --- a/composer.json +++ b/composer.json @@ -110,7 +110,8 @@ "App\\": "src/", "Plugin\\": "plugins/", "Component\\": "components/" - } + }, + "exclude-from-classmap": ["/tests/"] }, "autoload-dev": { "psr-4": { diff --git a/config/services.yaml b/config/services.yaml index 45b5ac9d9f..17684b5530 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -45,11 +45,11 @@ services: Plugin\: resource: '../plugins/*' - exclude: '../plugins/*/{scripts,classes,lib,actions,locale,doc}' + exclude: '../plugins/*/{scripts,classes,lib,actions,locale,doc,tests}' tags: ['controller.service_arguments'] Component\: resource: '../components/*' - exclude: '../components/*/{scripts,classes,lib,actions,locale,doc}' + exclude: '../components/*/{scripts,classes,lib,actions,locale,doc,tests}' tags: ['controller.service_arguments'] diff --git a/tests/Controller/SecurityTest.php b/tests/Controller/SecurityTest.php index 822363e918..e8a2d3f6f7 100644 --- a/tests/Controller/SecurityTest.php +++ b/tests/Controller/SecurityTest.php @@ -180,7 +180,7 @@ class SecurityTest extends GNUsocialTestCase public function testRegisterExistingEmail() { - [$client, ] = self::testRegister('other_new_nickname', 'email@provider.any', 'foobar'); + [$client, ] = self::testRegister('other_new_nickname', 'taken_user@provider.any', 'foobar'); $this->assertSelectorTextContains('.stacktrace', 'App\Util\Exception\EmailTakenException'); } }