From d5925dce96d5bf51b6cdf84c127679247b6fed3c Mon Sep 17 00:00:00 2001 From: Shishir Suvarna Date: Mon, 12 Feb 2024 11:56:23 +0530 Subject: [PATCH] Updated test case --- composer.json | 3 ++- .../ApigeeX/Controller/AppCredentialControllerTestBase.php | 6 +++--- .../Controller/AppGroupAppCredentialControllerTest.php | 6 +++--- .../v1/organizations/phpunit/appgroups/POST.json | 3 ++- .../v1/organizations/phpunit/appgroups/phpunit/PUT.json | 5 +++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 7f0add89..f4ef884f 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,8 @@ "*": "dist" }, "allow-plugins": { - "php-http/discovery": true + "php-http/discovery": true, + "cweagans/composer-patches": true } }, "minimum-stability": "dev", diff --git a/tests/Api/ApigeeX/Controller/AppCredentialControllerTestBase.php b/tests/Api/ApigeeX/Controller/AppCredentialControllerTestBase.php index 5644ddc7..ee4fe3b3 100644 --- a/tests/Api/ApigeeX/Controller/AppCredentialControllerTestBase.php +++ b/tests/Api/ApigeeX/Controller/AppCredentialControllerTestBase.php @@ -18,10 +18,10 @@ namespace Apigee\Edge\Tests\Api\ApigeeX\Controller; +use Apigee\Edge\Api\ApigeeX\Entity\AppGroup; use Apigee\Edge\Api\Management\Controller\AppCredentialControllerInterface; use Apigee\Edge\Api\Management\Entity\AppCredentialInterface; use Apigee\Edge\Api\Management\Entity\AppInterface; -use Apigee\Edge\Api\Management\Entity\AppOwnerInterface; use Apigee\Edge\Structure\CredentialProductInterface; use Apigee\Edge\Tests\Api\Management\Entity\ApiProductTestEntityProviderTrait; use Apigee\Edge\Tests\Test\Controller\DefaultAPIClientAwareTrait; @@ -330,9 +330,9 @@ public function testDelete(): void $this->assertFalse($found, 'Credential credential has not been deleted.'); } - abstract protected static function setupTestApp(AppOwnerInterface $appOwner): AppInterface; + abstract protected static function setupTestApp(AppGroup $appOwner): AppInterface; - abstract protected static function setupTestAppOwner(): AppOwnerInterface; + abstract protected static function setupTestAppOwner(): AppGroup; /** * @return \Apigee\Edge\Tests\Test\Controller\EntityControllerTesterInterface|\Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface diff --git a/tests/Api/ApigeeX/Controller/AppGroupAppCredentialControllerTest.php b/tests/Api/ApigeeX/Controller/AppGroupAppCredentialControllerTest.php index 85562193..875b47e3 100644 --- a/tests/Api/ApigeeX/Controller/AppGroupAppCredentialControllerTest.php +++ b/tests/Api/ApigeeX/Controller/AppGroupAppCredentialControllerTest.php @@ -19,9 +19,9 @@ namespace Apigee\Edge\Tests\Api\ApigeeX\Controller; use Apigee\Edge\Api\ApigeeX\Controller\AppGroupAppCredentialController; +use Apigee\Edge\Api\ApigeeX\Entity\AppGroup; use Apigee\Edge\Api\ApigeeX\Entity\AppGroupInterface; use Apigee\Edge\Api\Management\Entity\AppInterface; -use Apigee\Edge\Api\Management\Entity\AppOwnerInterface; use Apigee\Edge\ClientInterface; use Apigee\Edge\Entity\EntityInterface; use Apigee\Edge\Tests\Api\ApigeeX\Entity\AppGroupAppTestEntityProviderTrait; @@ -54,7 +54,7 @@ protected static function entityController(ClientInterface $client = null): Enti return new EntityControllerTester(new AppGroupAppCredentialController(static::defaultTestOrganization($client), static::$testAppOwner->id(), static::$testApp->id(), $client)); } - protected static function setupTestApp(AppOwnerInterface $appOwner): AppInterface + protected static function setupTestApp(AppGroup $appOwner): AppInterface { $app = static::getNewAppGroupApp(); static::appGroupAppController()->create($app); @@ -62,7 +62,7 @@ protected static function setupTestApp(AppOwnerInterface $appOwner): AppInterfac return $app; } - protected static function setupTestAppOwner(): AppOwnerInterface + protected static function setupTestAppOwner(): AppGroup { $appGroup = static::getNewAppGroup(); static::appGroupController()->create($appGroup); diff --git a/tests/offline-test-data/v1/organizations/phpunit/appgroups/POST.json b/tests/offline-test-data/v1/organizations/phpunit/appgroups/POST.json index c01a3e58..253d2117 100644 --- a/tests/offline-test-data/v1/organizations/phpunit/appgroups/POST.json +++ b/tests/offline-test-data/v1/organizations/phpunit/appgroups/POST.json @@ -1,5 +1,6 @@ { - "apps": [], + "channelUri": "http:\/\/example.com", + "channelId": "devportal", "name": "phpunit", "displayName": "A PHPUnit appgroup", "status": "active", diff --git a/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/PUT.json b/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/PUT.json index b35b8b85..fb9d96d3 100644 --- a/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/PUT.json +++ b/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/PUT.json @@ -1,5 +1,6 @@ { - "apps": [], + "channelUri": "http:\/\/example.com", + "channelId": "devportal", "name": "phpunit", "displayName": "(Edited) A PHPUnit appgroup", "status": "active", @@ -21,4 +22,4 @@ "createdBy": "phpunit@example.com", "lastModifiedAt": 1691588699000, "lastModifiedBy": "phpunit@example.com" -} +} \ No newline at end of file