Skip to content

Commit 7156cfe

Browse files
Copilotaddison74
andcommitted
Fix Rector errors in AddressTest.php
- Remove setAccessible(true) calls from ReflectionMethod invocations - Not needed in PHP 8.1+ for protected methods accessed via reflection Co-authored-by: addison74 <[email protected]>
1 parent 41270a6 commit 7156cfe

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

tests/unit/Mage/Sales/Model/Quote/AddressTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public function testPreservesExplicitlySetSameAsBillingForGuestOrders(): void
4848
// This is normally called when saving the address
4949
$reflectionClass = new \ReflectionClass($address);
5050
$method = $reflectionClass->getMethod('_populateBeforeSaveData');
51-
$method->setAccessible(true);
5251
$method->invoke($address);
5352

5453
// Assert that the explicitly set value was preserved
@@ -82,7 +81,6 @@ public function testSetsDefaultSameAsBillingForNewGuestAddressesWithoutExplicitV
8281
// Trigger the _populateBeforeSaveData method
8382
$reflectionClass = new \ReflectionClass($address);
8483
$method = $reflectionClass->getMethod('_populateBeforeSaveData');
85-
$method->setAccessible(true);
8684
$method->invoke($address);
8785

8886
// For guest orders, default behavior should set same_as_billing to 1
@@ -117,7 +115,6 @@ public function testPreservesExplicitlySetSameAsBillingTrue(): void
117115
// Trigger the _populateBeforeSaveData method
118116
$reflectionClass = new \ReflectionClass($address);
119117
$method = $reflectionClass->getMethod('_populateBeforeSaveData');
120-
$method->setAccessible(true);
121118
$method->invoke($address);
122119

123120
// Assert that the explicitly set value was preserved
@@ -151,7 +148,6 @@ public function testPreservesExplicitlySetSameAsBillingForRegisteredCustomers():
151148
// Trigger the _populateBeforeSaveData method
152149
$reflectionClass = new \ReflectionClass($address);
153150
$method = $reflectionClass->getMethod('_populateBeforeSaveData');
154-
$method->setAccessible(true);
155151
$method->invoke($address);
156152

157153
// Assert that the explicitly set value was preserved

0 commit comments

Comments
 (0)