Skip to content

Commit a82f3e9

Browse files
#19345: Removed caching subscription status from plugin - integration test fix.
1 parent b1f9f8e commit a82f3e9

File tree

1 file changed

+2
-2
lines changed
  • dev/tests/integration/testsuite/Magento/Newsletter/Controller/Manage

1 file changed

+2
-2
lines changed

dev/tests/integration/testsuite/Magento/Newsletter/Controller/Manage/SaveTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Customer\Model\Session;
1313
use Magento\Framework\Data\Form\FormKey;
1414
use Magento\Framework\Message\MessageInterface;
15+
use Magento\Newsletter\Model\CustomerSubscriberCache;
1516
use Magento\Newsletter\Model\Plugin\CustomerPlugin;
1617
use Magento\TestFramework\TestCase\AbstractController;
1718

@@ -69,7 +70,6 @@ protected function tearDown(): void
6970
public function testSaveAction(bool $isSubscribed, string $expectedMessage): void
7071
{
7172
$this->loginCustomer('new_customer@example.com');
72-
$this->_objectManager->removeSharedInstance(CustomerPlugin::class);
7373
$this->dispatchSaveAction($isSubscribed);
7474
$this->assertSuccessSubscription($expectedMessage);
7575
}
@@ -112,7 +112,6 @@ public function testSubscribeWithEnabledConfirmation(): void
112112
public function testUnsubscribeSubscribedCustomer(): void
113113
{
114114
$this->loginCustomer('new_customer@example.com');
115-
$this->_objectManager->removeSharedInstance(CustomerPlugin::class);
116115
$this->dispatchSaveAction(false);
117116
$this->assertSuccessSubscription('We have removed your newsletter subscription.');
118117
}
@@ -126,6 +125,7 @@ public function testUnsubscribeSubscribedCustomer(): void
126125
private function dispatchSaveAction(bool $isSubscribed): void
127126
{
128127
$this->_objectManager->removeSharedInstance(CustomerPlugin::class);
128+
$this->_objectManager->removeSharedInstance(CustomerSubscriberCache::class);
129129
$this->getRequest()->setParam('form_key', $this->formKey->getFormKey())
130130
->setParam('is_subscribed', $isSubscribed);
131131
$this->dispatch('newsletter/manage/save');

0 commit comments

Comments
 (0)