From: Eileen McNaughton Date: Tue, 8 Jun 2021 07:25:04 +0000 (+1200) Subject: Mark DetailTest as having invalid financials X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0a997f9fb3bb2b19f76465c3f93106dd4665cb7b;p=civicrm-core.git Mark DetailTest as having invalid financials This class sets up in a weird way it will never pass financial checks --- diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 709adc791a..54f59b1c7a 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -1064,7 +1064,6 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { // Allow each CMS to do a pre-flight check before redirecting to PayPal. CRM_Core_Config::singleton()->userSystem->prePostRedirect(); - CRM_Utils_System::redirect($paypalURL); } diff --git a/CRM/Utils/Hook/UnitTests.php b/CRM/Utils/Hook/UnitTests.php index 06d70f7454..7b07c1b5ce 100644 --- a/CRM/Utils/Hook/UnitTests.php +++ b/CRM/Utils/Hook/UnitTests.php @@ -22,12 +22,12 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { * @var array */ protected $adhocHooks; - protected $civiModules = NULL; + protected $civiModules; /** * Call this in CiviUnitTestCase::setUp() */ - public function reset() { + public function reset(): void { $this->mockObject = NULL; $this->adhocHooks = []; } @@ -36,23 +36,24 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { * Use a unit-testing mock object to handle hook invocations. * * e.g. hook_civicrm_foo === $mockObject->foo() - * Mocks with a magic `__call()` method are called for every hook invokation. + * Mocks with a magic `__call()` method are called for every hook invocation. * - * @param object $mockObject + * @param PHPUnit\Framework\MockObject\MockBuilder $mockObject */ - public function setMock($mockObject) { + public function setMock($mockObject): void { $this->mockObject = $mockObject; } /** * Register a function to run when invoking a specific hook. + * * @param string $hook * Hook name, e.g civicrm_pre. - * @param array $callable + * @param callable|array $callable * Function to call ie array(class, method). - * eg. array($this, mymethod) + * eg. array($this, myMethod) */ - public function setHook($hook, $callable) { + public function setHook(string $hook, $callable): void { $this->adhocHooks[$hook] = $callable; } @@ -76,7 +77,8 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { * @param string $fnSuffix * Function suffix, this is effectively the hook name. * - * @return mixed + * @return array|bool + * @throws \CRM_Core_Exception */ public function invokeViaUF( $numParams, @@ -84,7 +86,7 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { $fnSuffix) { $params = array(&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6); - $fResult1 = $fResult2 = $fResult3 = NULL; + $fResult2 = $fResult3 = NULL; // run standard hooks if ($this->civiModules === NULL) { diff --git a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php index 90f38c56f6..4fe96f8920 100644 --- a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php +++ b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php @@ -23,10 +23,17 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase { 'civicrm_contribution', ]; + /** + * Skip validating financials as the financial data is not correct in the csvs. + * + * @var bool + */ + protected $isValidateFinancialsOnPostAssert = FALSE; + /** * @return array */ - public function dataProvider() { + public function dataProvider(): array { return [ [ 'CRM_Report_Form_Contribute_Detail',