Skip to content

Commit

Permalink
Test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed Jul 25, 2017
1 parent fbb0964 commit 39d027a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ public function testDeleteStore()
$scope = 'stores';
$helperMock = $this->getMockBuilder(Ebizmarts_MailChimp_Helper_Data::class)
->disableOriginalConstructor()
->setMethods(array('getMCStoreId', 'getApiStores', 'getGeneralList', 'deleteCurrentWebhook', 'deleteLocalMCStoreData', 'logError'))
->setMethods(array('getMCStoreId', 'getApiStores', 'getGeneralList', 'deleteCurrentWebhook', 'deleteLocalMCStoreData'))
->getMock();
$apiStoresMock = $this->getMockBuilder(Ebizmarts_MailChimp_Model_Api_Stores::class)
->disableOriginalConstructor()
->getMock();

$helperMock->expects($this->once())->method('getMCStoreId')->with($scopeId, $scope)->willReturn('a18a1a8a1aa7aja1a');
$helperMock->expects($this->once())->method('getApiStores')->willReturn($apiStoresMock);
$helperMock->expects($this->once())->method('logError')->with('Error message', $scopeId, $scope);
$helperMock->expects($this->once())->method('getGeneralList')->with($scopeId, $scope)->willReturn('listId');
$helperMock->expects($this->once())->method('deleteCurrentWebhook')->with($scopeId, $scope, 'listId');
$helperMock->expects($this->once())->method('deleteLocalMCStoreData')->with($scopeId, $scope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testSendEcommerceBatch()

$helperMock = $this->getMockBuilder(Ebizmarts_MailChimp_Helper_Data::class)
->disableOriginalConstructor()
->setMethods(array('getMCStoreId', 'isMailChimpEnabled', 'isEcomSyncDataEnabled', 'getApi', 'getIsReseted'))
->setMethods(array('getMCStoreId', 'isMailChimpEnabled', 'isEcomSyncDataEnabled', 'getApi', 'getIsReseted', 'getMCIsSyncing'))
->getMock();

$apiCustomersMock = $this->getMockBuilder(Ebizmarts_MailChimp_Model_Api_Customers::class)
Expand Down Expand Up @@ -56,7 +56,7 @@ public function testSendEcommerceBatch()

$apiMock = $this->getMockBuilder(Ebizmarts_MailChimp::class)
->disableOriginalConstructor()
// ->setMethods(array(''))
// ->setMethods(array('edit'))
->getMock();

$apiBatchesMock->expects($this->once())->method('getHelper')->willReturn($helperMock);
Expand All @@ -69,6 +69,7 @@ public function testSendEcommerceBatch()
$helperMock->expects($this->once())->method('getMCStoreId')->with(1)->willReturn('b81c3085c51fa593e1d6b0cf59884f3e');
$helperMock->expects($this->once())->method('isMailChimpEnabled')->with(1)->willReturn(1);
$helperMock->expects($this->once())->method('isEcomSyncDataEnabled')->with(1)->willReturn(1);
$helperMock->expects($this->once())->method('getMCIsSyncing')->with(1)->willReturn(0);

$apiCustomersMock->expects($this->once())->method('createBatchJson')->with('b81c3085c51fa593e1d6b0cf59884f3e', 1);
$apiProductsMock->expects($this->once())->method('createBatchJson')->with('b81c3085c51fa593e1d6b0cf59884f3e', 1);
Expand Down

0 comments on commit 39d027a

Please sign in to comment.