-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afb0fee
commit ee69266
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
app/code/community/Mollie/Mpm/Test/Model/Client/OrdersTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
class Mollie_Mpm_Test_Model_Client_OrdersTest extends Mollie_Mpm_Test_TestHelpers_TestCase | ||
{ | ||
public function testUsesTheCorrectApiToResumeTheTransaction() | ||
{ | ||
$apiMock = $this->createMock('\Mollie\Api\MollieApiClient'); | ||
$ordersApiMock = $this->createMock('\Mollie\Api\Endpoints\OrderEndpoint'); | ||
$apiMock->orders = $ordersApiMock; | ||
|
||
// Make sure the right API is called. | ||
$ordersApiMock->expects($this->once())->method('get')->willReturn(new \Mollie\Api\Resources\Order($apiMock)); | ||
|
||
$mollieHelperMock = $this->getHelper('mpm'); | ||
$mollieHelperMock->method('getMollieAPI')->willReturn($apiMock); | ||
|
||
$order = $this->getMockBuilder('Mage_Sales_Model_Order') | ||
->setMethods(['getMollieTransactionId', 'getPayment']) | ||
->getMock(); | ||
|
||
$order->method('getMollieTransactionId')->willReturn(123); | ||
$order->method('getPayment')->willReturn(new Mage_Sales_Model_Order_Payment); | ||
|
||
$instance = new Mollie_Mpm_Model_Client_Orders(); | ||
$instance->startTransaction($order); | ||
} | ||
} |