Skip to content

Commit 6a4ecbe

Browse files
committed
Added lines *Deleted unnecessary uses
1 parent 8b1e739 commit 6a4ecbe

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ protected function setUp()
6464
$this->newsletterConfig = $this->createMock(\Magento\Newsletter\Model\Config::class);
6565
$context = $this->createMock(\Magento\Framework\View\Element\Template\Context::class);
6666
$context->expects($this->any())->method('getScopeConfig')->will($this->returnValue($this->_scopeConfig));
67+
6768
$this->_block = new \Magento\Customer\Block\Form\Register(
6869
$context,
6970
$this->directoryHelperMock,
@@ -296,13 +297,15 @@ public function testIsNewsletterEnabled($isNewsletterEnabled, $isNewsletterActiv
296297
)->will(
297298
$this->returnValue($isNewsletterEnabled)
298299
);
300+
299301
$this->newsletterConfig->expects(
300302
$this->any()
301303
)->method(
302304
'isActive'
303305
)->will(
304306
$this->returnValue($isNewsletterActive)
305307
);
308+
306309
$this->assertEquals($expectedValue, $this->_block->isNewsletterEnabled());
307310
}
308311

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,21 @@ public function testNewsletterEnabled() : void
8888
->disableOriginalConstructor()
8989
->setMethods(['getResponse', 'getData', 'setRedirect'])
9090
->getMockForAbstractClass();
91+
9192
$this->newsletterConfig->expects($this->once())
9293
->method('isActive')
9394
->with(ScopeInterface::SCOPE_STORE)
9495
->willReturn(true);
96+
9597
$observerMock->expects($this->never())
9698
->method('getData')
9799
->with('controller_action')
98100
->willReturnSelf();
101+
99102
$observerMock->expects($this->never())
100103
->method('getResponse')
101104
->willReturnSelf();
105+
102106
$this->assertNull($this->mockObject->execute($observerMock));
103107
}
104108

@@ -111,27 +115,34 @@ public function testNewsletterDisabled() : void
111115
->disableOriginalConstructor()
112116
->setMethods(['getControllerAction', 'getResponse'])
113117
->getMockForAbstractClass();
118+
114119
$this->newsletterConfig->expects($this->once())
115120
->method('isActive')
116121
->with(ScopeInterface::SCOPE_STORE)
117122
->willReturn(false);
123+
118124
$expectedRedirectUrl = 'https://test.com/index';
119125
$this->configMock->expects($this->once())
120126
->method('getValue')
121127
->with('web/default/no_route', ScopeInterface::SCOPE_STORE)
122128
->willReturn($expectedRedirectUrl);
129+
123130
$this->urlMock->expects($this->once())
124131
->method('getUrl')
125132
->willReturn($expectedRedirectUrl);
133+
126134
$observerMock->expects($this->once())
127135
->method('getControllerAction')
128136
->willReturnSelf();
137+
129138
$observerMock->expects($this->once())
130139
->method('getResponse')
131140
->willReturn($this->responseMock);
141+
132142
$this->responseMock->expects($this->once())
133143
->method('setRedirect')
134144
->with($expectedRedirectUrl);
145+
135146
$this->assertNull($this->mockObject->execute($observerMock));
136147
}
137148
}

dev/tests/integration/testsuite/Magento/Customer/_files/customer_subscribe.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
use Magento\Customer\Model\CustomerRegistry;
7-
86
$resourceConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
97
->create(\Magento\Config\Model\ResourceModel\Config::class);
108

0 commit comments

Comments
 (0)