From 08806c43e55fc7d5a3c0c5f42d1bd9a4b684727a Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 16 Jan 2025 14:00:00 +0530 Subject: [PATCH] Updated deprecated functions for PHPUnit 10 --- .../AcceptedRatePlanControllerTestBase.php | 4 ++-- .../AcceptedRatePlanControllerTestBase.php | 12 ++++++------ tests/Serializer/EntitySerializerTest.php | 2 +- .../PropertiesPropertyTransformationTest.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/Api/ApigeeX/Controller/AcceptedRatePlanControllerTestBase.php b/tests/Api/ApigeeX/Controller/AcceptedRatePlanControllerTestBase.php index dcc5fb2d9..bf09050a1 100644 --- a/tests/Api/ApigeeX/Controller/AcceptedRatePlanControllerTestBase.php +++ b/tests/Api/ApigeeX/Controller/AcceptedRatePlanControllerTestBase.php @@ -71,8 +71,8 @@ public function testAcceptRatePlan(): void $acceptedRatePlan = $acceptedController->acceptRatePlan($ratePlan); $payload = json_decode((string) static::mockApiClient()->getJournal()->getLastRequest()->getBody()); // Make sure we do not send properties with null values. - $this->assertObjectNotHasAttribute('endTime', $payload); - $this->assertObjectNotHasAttribute('startTime', $payload); + $this->assertObjectNotHasProperty('endTime', $payload); + $this->assertObjectNotHasProperty('startTime', $payload); // Make sure the properties copied from the response to the created // object. diff --git a/tests/Api/Monetization/Controller/AcceptedRatePlanControllerTestBase.php b/tests/Api/Monetization/Controller/AcceptedRatePlanControllerTestBase.php index 0dc5971f8..2fd35ccf3 100644 --- a/tests/Api/Monetization/Controller/AcceptedRatePlanControllerTestBase.php +++ b/tests/Api/Monetization/Controller/AcceptedRatePlanControllerTestBase.php @@ -73,10 +73,10 @@ public function testAcceptRatePlan(): void $acceptedRatePlan = $acceptedController->acceptRatePlan($ratePlan, $startDate); $payload = json_decode((string) static::mockApiClient()->getJournal()->getLastRequest()->getBody()); // Make sure we do not send properties with null values. - $this->assertObjectNotHasAttribute('endDate', $payload); - $this->assertObjectNotHasAttribute('quotaTarget', $payload); - $this->assertObjectNotHasAttribute('suppressWarning', $payload); - $this->assertObjectNotHasAttribute('waveTerminationCharge', $payload); + $this->assertObjectNotHasProperty('endDate', $payload); + $this->assertObjectNotHasProperty('quotaTarget', $payload); + $this->assertObjectNotHasProperty('suppressWarning', $payload); + $this->assertObjectNotHasProperty('waveTerminationCharge', $payload); // Make sure the properties copied from the response to the created // object. $this->assertNotNull($acceptedRatePlan->id()); @@ -115,8 +115,8 @@ public function testUpdateSubscription(): void $acceptedController->updateSubscription($acceptedRatePlan); $payload = json_decode((string) static::mockApiClient()->getJournal()->getLastRequest()->getBody()); // Make sure we do not send properties with null values. - $this->assertObjectNotHasAttribute('suppressWarning', $payload); - $this->assertObjectNotHasAttribute('waveTerminationCharge', $payload); + $this->assertObjectNotHasProperty('suppressWarning', $payload); + $this->assertObjectNotHasProperty('waveTerminationCharge', $payload); // Make sure response values override values in the original object. $this->assertEquals($originalStartDate, $acceptedRatePlan->getStartDate()); diff --git a/tests/Serializer/EntitySerializerTest.php b/tests/Serializer/EntitySerializerTest.php index fad933293..d8be89d82 100644 --- a/tests/Serializer/EntitySerializerTest.php +++ b/tests/Serializer/EntitySerializerTest.php @@ -101,7 +101,7 @@ public function testNormalize() $this->assertEquals(-1, $normalized->appCredential[0]->expiresAt); $this->assertEquals('foo', $normalized->appCredential[0]->apiProducts[0]->apiproduct); $this->assertEquals('foo', $normalized->appCredential[0]->attributes[0]->name); - $this->assertObjectNotHasAttribute('date', $normalized); + $this->assertObjectNotHasProperty('date', $normalized); $date = new DateTimeImmutable(); $entity->setDate($date); $normalized = static::$serializer->normalize($entity); diff --git a/tests/Structure/PropertiesPropertyTransformationTest.php b/tests/Structure/PropertiesPropertyTransformationTest.php index 179e5bcea..e99f98769 100644 --- a/tests/Structure/PropertiesPropertyTransformationTest.php +++ b/tests/Structure/PropertiesPropertyTransformationTest.php @@ -60,7 +60,7 @@ public function testNormalize() $object = new PropertiesProperty(['features.isCpsEnabled' => 'true']); $this->assertEquals('true', $object->getValue('features.isCpsEnabled')); $normalized = static::$normalizer->normalize($object); - $this->assertObjectHasAttribute('property', $normalized); + $this->assertObjectHasProperty('property', $normalized); $this->assertArrayHasKey(0, $normalized->property); $this->assertEquals('features.isCpsEnabled', $normalized->property[0]->name); $this->assertEquals('true', $normalized->property[0]->value);