Skip to content

Commit 3f90ebd

Browse files
committed
Replaced deprecated constant XML_PATH_NEWSLETTER_ACTIVE
1 parent dc4cc89 commit 3f90ebd

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

app/code/Magento/Customer/Block/Form/Register.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Magento\Customer\Block\Form;
77

88
use Magento\Customer\Model\AccountManagement;
9-
use Magento\Newsletter\Observer\PredispatchNewsletterObserver;
109

1110
/**
1211
* Customer register form block
@@ -170,7 +169,7 @@ public function getRegion()
170169
public function isNewsletterEnabled()
171170
{
172171
return $this->_moduleManager->isOutputEnabled('Magento_Newsletter')
173-
&& $this->getConfig(PredispatchNewsletterObserver::XML_PATH_NEWSLETTER_ACTIVE);
172+
&& $this->getConfig(\Magento\Newsletter\Model\Config::XML_PATH_NEWSLETTER_ACTIVE);
174173
}
175174

176175
/**

app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Customer\Block\Form\Register;
99
use Magento\Customer\Model\AccountManagement;
10-
use Magento\Newsletter\Observer\PredispatchNewsletterObserver;
1110

1211
/**
1312
* Test class for \Magento\Customer\Block\Form\Register.
@@ -298,7 +297,7 @@ public function testIsNewsletterEnabled($isNewsletterEnabled, $isNewsletterActiv
298297
)->method(
299298
'getValue'
300299
)->with(
301-
PredispatchNewsletterObserver::XML_PATH_NEWSLETTER_ACTIVE
300+
\Magento\Newsletter\Model\Config::XML_PATH_NEWSLETTER_ACTIVE
302301
)->will(
303302
$this->returnValue($isNewsletterActive)
304303
);

app/code/Magento/Newsletter/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Config
1717
/**
1818
* Configuration path to newsletter active setting
1919
*/
20-
private const XML_PATH_NEWSLETTER_ACTIVE = 'newsletter/general/active';
20+
const XML_PATH_NEWSLETTER_ACTIVE = 'newsletter/general/active';
2121

2222
/**
2323
* @var ScopeConfigInterface

app/code/Magento/Newsletter/Test/Unit/Observer/PredispatchNewsletterObserverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testNewsletterEnabled() : void
9090
->getMockForAbstractClass();
9191

9292
$this->configMock->method('getValue')
93-
->with(PredispatchNewsletterObserver::XML_PATH_NEWSLETTER_ACTIVE, ScopeInterface::SCOPE_STORE)
93+
->with(\Magento\Newsletter\Model\Config::XML_PATH_NEWSLETTER_ACTIVE, ScopeInterface::SCOPE_STORE)
9494
->willReturn(true);
9595
$observerMock->expects($this->never())
9696
->method('getData')
@@ -116,7 +116,7 @@ public function testNewsletterDisabled() : void
116116

117117
$this->configMock->expects($this->at(0))
118118
->method('getValue')
119-
->with(PredispatchNewsletterObserver::XML_PATH_NEWSLETTER_ACTIVE, ScopeInterface::SCOPE_STORE)
119+
->with(\Magento\Newsletter\Model\Config::XML_PATH_NEWSLETTER_ACTIVE, ScopeInterface::SCOPE_STORE)
120120
->willReturn(false);
121121

122122
$expectedRedirectUrl = 'https://test.com/index';

0 commit comments

Comments
 (0)