Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark DetailTest as having invalid financials #20552

Merged
merged 1 commit into from
Jun 9, 2021
Merged
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
1 change: 0 additions & 1 deletion CRM/Core/Payment/PayPalImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,6 @@ public function doPaymentRedirectToPayPal(&$params, $component = 'contribute') {

// Allow each CMS to do a pre-flight check before redirecting to PayPal.
CRM_Core_Config::singleton()->userSystem->prePostRedirect();

CRM_Utils_System::redirect($paypalURL);
}

Expand Down
22 changes: 12 additions & 10 deletions CRM/Utils/Hook/UnitTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
}
Expand All @@ -36,23 +36,24 @@ public function reset() {
* 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;
}

Expand All @@ -76,15 +77,16 @@ public function setHook($hook, $callable) {
* @param string $fnSuffix
* Function suffix, this is effectively the hook name.
*
* @return mixed
* @return array|bool
* @throws \CRM_Core_Exception
*/
public function invokeViaUF(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix) {
$params = array(&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6);

$fResult1 = $fResult2 = $fResult3 = NULL;
$fResult2 = $fResult3 = NULL;

// run standard hooks
if ($this->civiModules === NULL) {
Expand Down
9 changes: 8 additions & 1 deletion tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down