Skip to content

Commit

Permalink
Add test that we can set 'Pending from Approval' for participant stat…
Browse files Browse the repository at this point in the history
…us via Order API
  • Loading branch information
mattwire committed Aug 21, 2020
1 parent a7e3645 commit 13acdb1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/phpunit/api/v3/OrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ public function testAddOrderForParticipant() {
'role_id' => 1,
'register_date' => '2007-07-21 00:00:00',
'source' => 'Online Event Registration: API Testing',
'participant_status_id' => 'Pending from approval',
],
];

Expand All @@ -358,12 +359,15 @@ public function testAddOrderForParticipant() {
'net_amount' => 600,
],
];
$paymentParticipant = [
$orderParams = [
'contribution_id' => $order['id'],
];
$order = $this->callAPISuccess('order', 'get', $paymentParticipant);
$order = $this->callAPISuccess('order', 'get', $orderParams);
$this->checkPaymentResult($order, $expectedResult);
$this->callAPISuccessGetCount('ParticipantPayment', $paymentParticipant, 2);
$paymentParticipant = $this->callAPISuccess('ParticipantPayment', 'get', $orderParams)['values'];
$this->assertEquals(2, count($paymentParticipant), 'Expected two participant payments');
$participant = $this->callAPISuccessGetSingle('Participant', ['participant_id' => end($paymentParticipant)['participant_id']]);
$this->assertEquals('Pending from approval', $participant['participant_status']);
$this->callAPISuccess('Contribution', 'Delete', [
'id' => $order['id'],
]);
Expand Down

0 comments on commit 13acdb1

Please sign in to comment.