From bd5e928627e662cd9167ec1d889880d354c196e6 Mon Sep 17 00:00:00 2001 From: Shishir <75600200+shishir-intelli@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:46:44 +0530 Subject: [PATCH] Added ApigeeEdgeKernelTestBase as base class for Kernel testcases (#975) --- .../src/Kernel/Entity/TeamViewBuilderTest.php | 4 +- .../src/Kernel/EntityControllerCacheTest.php | 4 +- .../Kernel/Event/TeamInvitationEventsTest.php | 4 +- tests/src/Kernel/ApigeeEdgeKernelTestBase.php | 42 +++++++++++++++++++ .../Kernel/Entity/AppWarningsCheckerTest.php | 4 +- .../Entity/ListBuilder/AppListBuilderTest.php | 4 +- .../ListBuilder/EntityListBuilderTest.php | 4 +- tests/src/Kernel/TestFrameworkKernelTest.php | 4 +- .../ApigeeEdgeManagementCliServiceTest.php | 4 +- 9 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 tests/src/Kernel/ApigeeEdgeKernelTestBase.php diff --git a/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php b/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php index 00556f92d..c4dd0f4e1 100644 --- a/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php +++ b/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php @@ -20,7 +20,7 @@ namespace Drupal\Tests\apigee_edge_teams\Kernel\Entity; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestTrait; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; @@ -32,7 +32,7 @@ * @group apigee_edge_teams * @group apigee_edge_teams_kernel */ -class TeamViewBuilderTest extends KernelTestBase { +class TeamViewBuilderTest extends ApigeeEdgeKernelTestBase { use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait; diff --git a/modules/apigee_edge_teams/tests/src/Kernel/EntityControllerCacheTest.php b/modules/apigee_edge_teams/tests/src/Kernel/EntityControllerCacheTest.php index 595d59c75..6908898f0 100644 --- a/modules/apigee_edge_teams/tests/src/Kernel/EntityControllerCacheTest.php +++ b/modules/apigee_edge_teams/tests/src/Kernel/EntityControllerCacheTest.php @@ -20,7 +20,7 @@ namespace Drupal\Tests\apigee_edge_teams\Kernel; use Apigee\Edge\Api\Management\Entity\Company; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_edge\Traits\EntityControllerCacheUtilsTrait; /** @@ -31,7 +31,7 @@ * @group apigee_edge_teams * @group apigee_edge_teams_kernel */ -class EntityControllerCacheTest extends KernelTestBase { +class EntityControllerCacheTest extends ApigeeEdgeKernelTestBase { use EntityControllerCacheUtilsTrait; diff --git a/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php b/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php index 62435316c..ae0a63fe1 100644 --- a/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php +++ b/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php @@ -24,7 +24,7 @@ use Drupal\apigee_edge_teams\Entity\TeamInvitation; use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; /** @@ -35,7 +35,7 @@ * @group apigee_edge_teams * @group apigee_edge_teams_kernel */ -class TeamInvitationEventsTest extends KernelTestBase { +class TeamInvitationEventsTest extends ApigeeEdgeKernelTestBase { use ApigeeMockApiClientHelperTrait { apigeeTestHelperSetup as baseSetUp; diff --git a/tests/src/Kernel/ApigeeEdgeKernelTestBase.php b/tests/src/Kernel/ApigeeEdgeKernelTestBase.php new file mode 100644 index 000000000..41446117a --- /dev/null +++ b/tests/src/Kernel/ApigeeEdgeKernelTestBase.php @@ -0,0 +1,42 @@ +markTestSkipped('This test suite is expecting a PUBLIC instance type.'); + } + parent::setUp(); + } + +} diff --git a/tests/src/Kernel/Entity/AppWarningsCheckerTest.php b/tests/src/Kernel/Entity/AppWarningsCheckerTest.php index 2e6b38436..1420b2be0 100644 --- a/tests/src/Kernel/Entity/AppWarningsCheckerTest.php +++ b/tests/src/Kernel/Entity/AppWarningsCheckerTest.php @@ -25,7 +25,7 @@ use Drupal\apigee_edge\Entity\ApiProduct; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Entity\DeveloperApp; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestTrait; use Drupal\Tests\apigee_edge\Traits\CredsUtilsTrait; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; @@ -39,7 +39,7 @@ * @group apigee_edge * @group apigee_edge_kernel */ -class AppWarningsCheckerTest extends KernelTestBase { +class AppWarningsCheckerTest extends ApigeeEdgeKernelTestBase { use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait, UserCreationTrait, CredsUtilsTrait; diff --git a/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php b/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php index f92830c01..3ec5e6a8b 100644 --- a/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php +++ b/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php @@ -27,7 +27,7 @@ use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\Component\Utility\Html; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestTrait; use Drupal\Tests\apigee_edge\Traits\CredsUtilsTrait; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; @@ -41,7 +41,7 @@ * @group apigee_edge * @group apigee_edge_kernel */ -class AppListBuilderTest extends KernelTestBase { +class AppListBuilderTest extends ApigeeEdgeKernelTestBase { use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait, UserCreationTrait, CredsUtilsTrait; diff --git a/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php b/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php index caa3ef758..0f4db6fb9 100644 --- a/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php +++ b/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php @@ -22,7 +22,7 @@ use Drupal\Core\Entity\Entity\EntityViewMode; use Drupal\Core\Url; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestTrait; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\Tests\user\Traits\UserCreationTrait; @@ -35,7 +35,7 @@ * @group apigee_edge * @group apigee_edge_kernel */ -class EntityListBuilderTest extends KernelTestBase { +class EntityListBuilderTest extends ApigeeEdgeKernelTestBase { use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait, UserCreationTrait; diff --git a/tests/src/Kernel/TestFrameworkKernelTest.php b/tests/src/Kernel/TestFrameworkKernelTest.php index 9705bf7df..b7b783be3 100644 --- a/tests/src/Kernel/TestFrameworkKernelTest.php +++ b/tests/src/Kernel/TestFrameworkKernelTest.php @@ -21,7 +21,7 @@ use Drupal\apigee_edge\Entity\Developer; use Drupal\Core\Form\FormState; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\Tests\user\Traits\UserCreationTrait; use GuzzleHttp\Psr7\Response; @@ -33,7 +33,7 @@ * @group apigee_edge * @group apigee_edge_kernel */ -class TestFrameworkKernelTest extends KernelTestBase { +class TestFrameworkKernelTest extends ApigeeEdgeKernelTestBase { use ApigeeMockApiClientHelperTrait; use UserCreationTrait; diff --git a/tests/src/Kernel/Util/ApigeeEdgeManagementCliServiceTest.php b/tests/src/Kernel/Util/ApigeeEdgeManagementCliServiceTest.php index 2609ce157..78e174353 100644 --- a/tests/src/Kernel/Util/ApigeeEdgeManagementCliServiceTest.php +++ b/tests/src/Kernel/Util/ApigeeEdgeManagementCliServiceTest.php @@ -23,7 +23,7 @@ use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceModifierInterface; use Drupal\Core\Utility\Error; -use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; /** @@ -37,7 +37,7 @@ * @group apigee_edge * @group apigee_edge_kernel */ -class ApigeeEdgeManagementCliServiceTest extends KernelTestBase implements ServiceModifierInterface { +class ApigeeEdgeManagementCliServiceTest extends ApigeeEdgeKernelTestBase implements ServiceModifierInterface { use ApigeeMockApiClientHelperTrait;