Skip to content

Commit

Permalink
Merge branch 'apigee:3.x' into tableprefix_deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
divya-intelli authored Nov 15, 2023
2 parents 9c63b99 + bd5e928 commit db3f18d
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -32,7 +32,7 @@
* @group apigee_edge_teams
* @group apigee_edge_teams_kernel
*/
class TeamViewBuilderTest extends KernelTestBase {
class TeamViewBuilderTest extends ApigeeEdgeKernelTestBase {

use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -31,7 +31,7 @@
* @group apigee_edge_teams
* @group apigee_edge_teams_kernel
*/
class EntityControllerCacheTest extends KernelTestBase {
class EntityControllerCacheTest extends ApigeeEdgeKernelTestBase {

use EntityControllerCacheUtilsTrait;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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;
Expand Down
42 changes: 42 additions & 0 deletions tests/src/Kernel/ApigeeEdgeKernelTestBase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* Copyright 2023 Google Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

namespace Drupal\Tests\apigee_edge\Kernel;

use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface;
use Drupal\KernelTests\KernelTestBase;

/**
* Base class for kernel tests.
*/
abstract class ApigeeEdgeKernelTestBase extends KernelTestBase {

/**
* {@inheritdoc}
*/
protected function setUp(): void {
// Skipping the test if instance type is hybrid.
$instance_type = getenv('APIGEE_EDGE_INSTANCE_TYPE');
if (!empty($instance_type) && $instance_type === EdgeKeyTypeInterface::INSTANCE_TYPE_HYBRID) {
$this->markTestSkipped('This test suite is expecting a PUBLIC instance type.');
}
parent::setUp();
}

}
4 changes: 2 additions & 2 deletions tests/src/Kernel/Entity/AppWarningsCheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -39,7 +39,7 @@
* @group apigee_edge
* @group apigee_edge_kernel
*/
class AppWarningsCheckerTest extends KernelTestBase {
class AppWarningsCheckerTest extends ApigeeEdgeKernelTestBase {

use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait, UserCreationTrait, CredsUtilsTrait;

Expand Down
4 changes: 2 additions & 2 deletions tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,7 +41,7 @@
* @group apigee_edge
* @group apigee_edge_kernel
*/
class AppListBuilderTest extends KernelTestBase {
class AppListBuilderTest extends ApigeeEdgeKernelTestBase {

use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait, UserCreationTrait, CredsUtilsTrait;

Expand Down
4 changes: 2 additions & 2 deletions tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,7 +35,7 @@
* @group apigee_edge
* @group apigee_edge_kernel
*/
class EntityListBuilderTest extends KernelTestBase {
class EntityListBuilderTest extends ApigeeEdgeKernelTestBase {

use ApigeeMockApiClientHelperTrait, ApigeeEdgeKernelTestTrait, UserCreationTrait;

Expand Down
4 changes: 2 additions & 2 deletions tests/src/Kernel/TestFrameworkKernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,7 +33,7 @@
* @group apigee_edge
* @group apigee_edge_kernel
*/
class TestFrameworkKernelTest extends KernelTestBase {
class TestFrameworkKernelTest extends ApigeeEdgeKernelTestBase {

use ApigeeMockApiClientHelperTrait;
use UserCreationTrait;
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Kernel/Util/ApigeeEdgeManagementCliServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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;

Expand Down

0 comments on commit db3f18d

Please sign in to comment.