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

Add unit test to hit class-loader issue #24712

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 12 additions & 0 deletions tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Civi\Api4\DedupeRule;
use Civi\Api4\DedupeRuleGroup;
use Civi\Api4\Email;
use Civi\Api4\Import;
use Civi\Api4\Note;
use Civi\Api4\OptionValue;
use Civi\Api4\UserJob;
Expand Down Expand Up @@ -43,6 +44,7 @@ public function tearDown(): void {
DedupeRule::delete()
->addWhere('rule_table', '!=', 'civicrm_email')
->addWhere('dedupe_rule_group_id.name', '=', 'IndividualUnsupervised')->execute();
$this->callAPISuccess('Extension', 'disable', ['key' => 'civiimport']);
parent::tearDown();
}

Expand Down Expand Up @@ -817,4 +819,14 @@ protected function addToDedupeRule(): void {
]);
}

/**
* Test the Import api works from the extension when the extension is enabled after the import.
*/
public function testEnableExtension(): void {
$this->importContributionsDotCSV();
$this->callAPISuccess('Extension', 'enable', ['key' => 'civiimport']);
$result = Import::get($this->userJobID)->execute();
$this->assertEquals('ERROR', $result->first()['_status']);
}

}