Skip to content

Commit

Permalink
BG2-2250: Fix PHPUnit deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
bdsl committed Jan 8, 2024
1 parent 6647335 commit d472947
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions tests/Application/Actions/Person/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public function testSuccess(): void

$this->assertNotEmpty($payload->updated_at);
$this->assertFalse($payload->has_password);
$this->assertObjectNotHasAttribute('raw_password', $payload);
$this->assertObjectNotHasAttribute('password', $payload);
$this->assertObjectNotHasProperty('raw_password', $payload);
$this->assertObjectNotHasProperty('password', $payload);
}

public function testFailingCaptcha(): void
Expand Down
30 changes: 15 additions & 15 deletions tests/Application/Actions/Person/GetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public function testSuccessWithSpendableStripeBalances(): void

$this->assertTrue($payload->has_password);
// These should be unset by `HasPasswordNormalizer`.
$this->assertObjectNotHasAttribute('raw_password', $payload);
$this->assertObjectNotHasAttribute('password', $payload);
$this->assertObjectNotHasProperty('raw_password', $payload);
$this->assertObjectNotHasProperty('password', $payload);

$this->assertObjectHasAttribute('cash_balance', $payload);
$this->assertObjectHasProperty('cash_balance', $payload);
$this->assertIsObject($payload->cash_balance);
$this->assertEquals((object) [
'eur' => 123,
Expand Down Expand Up @@ -109,11 +109,11 @@ public function testSuccessWithZeroStripeBalances(): void

$this->assertTrue($payload->has_password);
// These should be unset by `HasPasswordNormalizer`.
$this->assertObjectNotHasAttribute('raw_password', $payload);
$this->assertObjectNotHasAttribute('password', $payload);
$this->assertObjectNotHasProperty('raw_password', $payload);
$this->assertObjectNotHasProperty('password', $payload);

$this->assertIsObject($payload->cash_balance);
$this->assertObjectNotHasAttribute('gbp', $payload->cash_balance);
$this->assertObjectNotHasProperty('gbp', $payload->cash_balance);
}

public function testSuccessWithNoStripeBalances(): void
Expand Down Expand Up @@ -153,11 +153,11 @@ public function testSuccessWithNoStripeBalances(): void

$this->assertTrue($payload->has_password);
// These should be unset by `HasPasswordNormalizer`.
$this->assertObjectNotHasAttribute('raw_password', $payload);
$this->assertObjectNotHasAttribute('password', $payload);
$this->assertObjectNotHasProperty('raw_password', $payload);
$this->assertObjectNotHasProperty('password', $payload);

$this->assertIsObject($payload->cash_balance);
$this->assertObjectNotHasAttribute('gbp', $payload->cash_balance);
$this->assertObjectNotHasProperty('gbp', $payload->cash_balance);
}

public function testSuccessWithPendingTipAndNoBalances(): void
Expand Down Expand Up @@ -199,9 +199,9 @@ public function testSuccessWithPendingTipAndNoBalances(): void
$payload = json_decode($payloadJSON, false, 512, JSON_THROW_ON_ERROR);

$this->assertIsObject($payload->cash_balance);
$this->assertObjectNotHasAttribute('gbp', $payload->cash_balance);
$this->assertObjectNotHasProperty('gbp', $payload->cash_balance);

$this->assertObjectHasAttribute('pending_tip_balance', $payload);
$this->assertObjectHasProperty('pending_tip_balance', $payload);
$this->assertIsObject($payload->pending_tip_balance);
$this->assertEquals((object) [
'gbp' => 1_000_00, // £1,000 tip (per mock response derived from local tests)
Expand Down Expand Up @@ -245,12 +245,12 @@ public function testSuccessWithNonAutomaticallyReconciledStripeBalances(): void

$this->assertTrue($payload->has_password);
// These should be unset by `HasPasswordNormalizer`.
$this->assertObjectNotHasAttribute('raw_password', $payload);
$this->assertObjectNotHasAttribute('password', $payload);
$this->assertObjectNotHasProperty('raw_password', $payload);
$this->assertObjectNotHasProperty('password', $payload);

$this->assertIsObject($payload->cash_balance);
$this->assertObjectNotHasAttribute('eur', $payload->cash_balance);
$this->assertObjectNotHasAttribute('gbp', $payload->cash_balance);
$this->assertObjectNotHasProperty('eur', $payload->cash_balance);
$this->assertObjectNotHasProperty('gbp', $payload->cash_balance);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/Application/Actions/Person/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public function testSuccessSettingPassword(): void

$this->assertTrue($payload->has_password);
// These should be unset by `HasPasswordNormalizer`.
$this->assertObjectNotHasAttribute('raw_password', $payload);
$this->assertObjectNotHasAttribute('password', $payload);
$this->assertObjectNotHasProperty('raw_password', $payload);
$this->assertObjectNotHasProperty('password', $payload);

// Validate that the response contains the original, not the fake overridden, Stripe
// customer ID.
Expand Down Expand Up @@ -304,8 +304,8 @@ public function testSuccessSettingOnlyPersonInfo(): void
$this->assertTrue(new \DateTime($payload->updated_at) >= (new \DateTime())->sub(new \DateInterval('PT5S')));

$this->assertFalse($payload->has_password);
$this->assertObjectNotHasAttribute('raw_password', $payload);
$this->assertObjectNotHasAttribute('password', $payload);
$this->assertObjectNotHasProperty('raw_password', $payload);
$this->assertObjectNotHasProperty('password', $payload);
}

public function testMissingData(): void
Expand Down

0 comments on commit d472947

Please sign in to comment.