Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());

Expand Down
2 changes: 1 addition & 1 deletion tests/Serializer/EntitySerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/Structure/PropertiesPropertyTransformationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading