Merge pull request #9425 from colemanw/CRM-19649
[civicrm-core.git] / tests / phpunit / CRM / Event / Form / Registration / ConfirmTest.php
1 <?php
2
3 /**
4 * Test CRM_Event_Form_Registration functions.
5 *
6 * @package CiviCRM
7 * @group headless
8 */
9 class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase {
10
11 public function setUp() {
12 $this->useTransaction(TRUE);
13 parent::setUp();
14 }
15
16 /**
17 * Initial test of submit function.
18 *
19 * @throws \Exception
20 */
21 public function testSubmit() {
22 $event = $this->eventCreate();
23 CRM_Event_Form_Registration_Confirm::testSubmit(array(
24 'id' => $event['id'],
25 'contributeMode' => 'direct',
26 'registerByID' => $this->createLoggedInUser(),
27 'params' => array(
28 array(
29 'qfKey' => 'e6eb2903eae63d4c5c6cc70bfdda8741_2801',
30 'entryURL' => 'http://dmaster.local/civicrm/event/register?reset=1&amp;id=3',
31 'first_name' => 'k',
32 'last_name' => 'p',
33 'email-Primary' => 'demo@example.com',
34 'hidden_processor' => '1',
35 'credit_card_number' => '4111111111111111',
36 'cvv2' => '123',
37 'credit_card_exp_date' => array(
38 'M' => '1',
39 'Y' => '2019',
40 ),
41 'credit_card_type' => 'Visa',
42 'billing_first_name' => 'p',
43 'billing_middle_name' => '',
44 'billing_last_name' => 'p',
45 'billing_street_address-5' => 'p',
46 'billing_city-5' => 'p',
47 'billing_state_province_id-5' => '1061',
48 'billing_postal_code-5' => '7',
49 'billing_country_id-5' => '1228',
50 'scriptFee' => '',
51 'scriptArray' => '',
52 'priceSetId' => '6',
53 'price_7' => array(
54 13 => 1,
55 ),
56 'payment_processor_id' => '1',
57 'bypass_payment' => '',
58 'MAX_FILE_SIZE' => '33554432',
59 'is_primary' => 1,
60 'is_pay_later' => 0,
61 'campaign_id' => NULL,
62 'defaultRole' => 1,
63 'participant_role_id' => '1',
64 'currencyID' => 'USD',
65 'amount_level' => '\ 1Tiny-tots (ages 5-8) - 1\ 1',
66 'amount' => '800.00',
67 'tax_amount' => NULL,
68 'year' => '2019',
69 'month' => '1',
70 'ip_address' => '127.0.0.1',
71 'invoiceID' => '57adc34957a29171948e8643ce906332',
72 'button' => '_qf_Register_upload',
73 'billing_state_province-5' => 'AP',
74 'billing_country-5' => 'US',
75 ),
76 ),
77 ));
78 $this->callAPISuccessGetSingle('Participant', array());
79 }
80
81 }