Skip to content

Commit

Permalink
Merge branch 'develop' into release/3.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Waldstein committed Nov 20, 2024
2 parents 1e8b664 + 244944b commit 72998a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/FormMigration/FormMetaDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public function isConstantContactEnabled(): bool
$isFormDisabled = give_is_setting_enabled($this->getMeta('_give_constant_contact_disable'), 'true');

$isGloballyEnabled = give_is_setting_enabled(
give_get_option('give_constant_contact_show_checkout_signup'),
give_get_option('givewp_constant_contact_show_checkout_signup'),
'on'
);

Expand All @@ -532,7 +532,7 @@ public function isConstantContactEnabled(): bool
*/
public function getConstantContactLabel(): string
{
$defaultMeta = give_get_option('give_constant_contact_label', __('Subscribe to our newsletter?'));
$defaultMeta = give_get_option('givewp_constant_contact_label', __('Subscribe to our newsletter?'));

return $this->getMeta('_give_constant_contact_custom_label', $defaultMeta);
}
Expand All @@ -544,7 +544,7 @@ public function getConstantContactDefaultChecked(): bool
{
$defaultMeta = give_is_setting_enabled(
give_get_option(
'give_constant_contact_checked_default',
'givewp_constant_contact_checked_default',
true
),
'on'
Expand All @@ -558,7 +558,7 @@ public function getConstantContactDefaultChecked(): bool
*/
public function getConstantContactSelectedLists(): array
{
$defaultMeta = give_get_option('give_constant_contact_list', []);
$defaultMeta = give_get_option('givewp_constant_contact_list', []);

return (array)$this->getMeta('_give_constant_contact', $defaultMeta);
}
Expand Down
14 changes: 7 additions & 7 deletions tests/Feature/FormMigration/Steps/TestConstantContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public function testFormMigratesUsingGlobalSettingsWhenGloballyEnabled(): void
{
// Arrange
$options = [
'give_constant_contact_show_checkout_signup' => 'on',
'give_constant_contact_label' => 'Subscribe to our newsletter?',
'give_constant_contact_checked_default' => 'on',
'give_constant_contact_list' => ['1928414891'],
'givewp_constant_contact_show_checkout_signup' => 'on',
'givewp_constant_contact_label' => 'Subscribe to our newsletter?',
'givewp_constant_contact_checked_default' => 'on',
'givewp_constant_contact_list' => ['1928414891'],
];
foreach ($options as $key => $value) {
give_update_option($key, $value);
Expand All @@ -43,8 +43,8 @@ public function testFormMigratesUsingGlobalSettingsWhenGloballyEnabled(): void
// Assert
$block = $v3Form->blocks->findByName('givewp/constantcontact');
$this->assertTrue(true, $block->getAttribute('checked' === 'on'));
$this->assertSame($options['give_constant_contact_label'], $block->getAttribute('label'));
$this->assertSame($options['give_constant_contact_list'], $block->getAttribute('selectedEmailLists'));
$this->assertSame($options['givewp_constant_contact_label'], $block->getAttribute('label'));
$this->assertSame($options['givewp_constant_contact_list'], $block->getAttribute('selectedEmailLists'));
}

/**
Expand All @@ -53,7 +53,7 @@ public function testFormMigratesUsingGlobalSettingsWhenGloballyEnabled(): void
public function testFormConfiguredToDisableConstantContactIsMigratedWithoutConstantContactBlock()
{
// Arrange
give_update_option('give_constant_contact_show_checkout_signup', 'on');
give_update_option('givewp_constant_contact_show_checkout_signup', 'on');
$meta = ['_give_constant_contact_disable' => 'true'];
$v2Form = $this->createSimpleDonationForm(['meta' => $meta]);

Expand Down

0 comments on commit 72998a1

Please sign in to comment.