Skip to content

Commit f7085e4

Browse files
committed
MAGETWO-33654: Unable to save newsletter subscription information of customer in backend
1 parent 2f97c00 commit f7085e4

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function setUp()
5151
$this->formFactoryMock = $this->getMock('\Magento\Framework\Data\FormFactory', [], [], '', false);
5252
$this->subscriberFactoryMock = $this->getMock(
5353
'\Magento\Newsletter\Model\SubscriberFactory',
54-
[],
54+
['create'],
5555
[],
5656
'',
5757
false

app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ public function testExecuteWithExistentCustomerAndNoAddresses()
333333

334334
$this->customerDataFactoryMock->expects($this->once())
335335
->method('create')
336-
->with([])
337336
->willReturn($customerMock);
338337

339338
$this->customerRepositoryMock->expects($this->once())
@@ -503,7 +502,6 @@ public function testExecuteWithNewCustomerAndNoAddresses()
503502

504503
$this->customerDataFactoryMock->expects($this->once())
505504
->method('create')
506-
->with([])
507505
->willReturn($customerMock);
508506

509507
$this->managementMock->expects($this->once())
@@ -560,13 +558,12 @@ public function testExecuteWithNewCustomerAndNoAddresses()
560558

561559
$this->redirectFactoryMock->expects($this->once())
562560
->method('create')
563-
->with([])
564561
->willReturn($redirectMock);
565562

566563
$redirectMock->expects($this->once())
567564
->method('setPath')
568565
->with('customer/index', [])
569-
->willReturn(true);
566+
->willReturnSelf();
570567

571568
$this->assertEquals($redirectMock, $this->model->execute());
572569
}
@@ -660,7 +657,6 @@ public function testExecuteWithNewCustomerAndValidationException()
660657

661658
$this->customerDataFactoryMock->expects($this->once())
662659
->method('create')
663-
->with([])
664660
->willReturn($customerMock);
665661

666662
$this->managementMock->expects($this->once())
@@ -801,7 +797,6 @@ public function testExecuteWithNewCustomerAndLocalizedException()
801797

802798
$this->customerDataFactoryMock->expects($this->once())
803799
->method('create')
804-
->with([])
805800
->willReturn($customerMock);
806801

807802
$this->managementMock->expects($this->once())
@@ -942,7 +937,6 @@ public function testExecuteWithNewCustomerAndException()
942937

943938
$this->customerDataFactoryMock->expects($this->once())
944939
->method('create')
945-
->with([])
946940
->willReturn($customerMock);
947941

948942
$exception = new \Exception(__('Exception'));

0 commit comments

Comments
 (0)