From be3c7eb35b2de89ef83eb63b767fa72e0bfeccc8 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 31 Dec 2020 01:29:43 -0800 Subject: [PATCH] (REF) PaymentTest - Use "Invasive" helper It's shorter/prettier. --- tests/phpunit/CRM/Core/PaymentTest.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/CRM/Core/PaymentTest.php b/tests/phpunit/CRM/Core/PaymentTest.php index a93759f731..3615719a07 100644 --- a/tests/phpunit/CRM/Core/PaymentTest.php +++ b/tests/phpunit/CRM/Core/PaymentTest.php @@ -9,6 +9,8 @@ +--------------------------------------------------------------------+ */ +use Civi\Test\Invasive; + /** * Class CRM_Core_PaymentTest * @group headless @@ -64,14 +66,8 @@ class CRM_Core_PaymentTest extends CiviUnitTestCase { $processor->setCancelUrl($cancel); $processor->setSuccessUrl($success); - // Using ReflectionUtils to access protected methods - $successGetter = new ReflectionMethod($processor, 'getReturnSuccessUrl'); - $successGetter->setAccessible(TRUE); - $this->assertEquals($success, $successGetter->invoke($processor, NULL)); - - $cancelGetter = new ReflectionMethod($processor, 'getReturnFailUrl'); - $cancelGetter->setAccessible(TRUE); - $this->assertEquals($cancel, $cancelGetter->invoke($processor, NULL)); + $this->assertEquals($success, Invasive::call([$processor, 'getReturnSuccessUrl'], [NULL])); + $this->assertEquals($cancel, Invasive::call([$processor, 'getReturnFailUrl'], [NULL])); } } -- 2.25.1