Skip to content

Commit

Permalink
tests: add testCreatesParentCampaignForOptionBasedDonationForm method
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Dec 16, 2024
1 parent b103864 commit eac9127
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,31 @@ public function testCreatesParentCampaignForDonationForm()
$this->assertEquals($form->id, $relationship->form_id);
}

/**
* @unreleased
*
* @throws Exception
*/
public function testCreatesParentCampaignForOptionBasedDonationForm()
{
$formId = $this->factory()->post->create(
[
'post_title' => 'Test Form',
'post_type' => 'give_forms',
'post_status' => 'publish',
]
);

$migration = new MigrateFormsToCampaignForms();

$migration->run();

$relationship = DB::table('give_campaign_forms')->where('form_id', $formId)->get();

$this->assertNotNull(Campaign::find($relationship->campaign_id));
$this->assertEquals($formId, $relationship->form_id);
}

/**
* @unreleased
*
Expand Down

0 comments on commit eac9127

Please sign in to comment.