public function UbercartCreditCardTestCase::testCheckout in Ubercart 7.3
Tests that an order can be placed using the test gateway.
File
- payment/
uc_credit/ tests/ uc_credit.test, line 281 - Credit card payment method tests.
Class
- UbercartCreditCardTestCase
- Tests credit card payments with the test gateway.
Code
public function testCheckout() {
$this
->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
$this
->checkout(array(
'panes[payment][details][cc_number]' => array_rand(array_flip(self::$test_cards)),
'panes[payment][details][cc_cvv]' => mt_rand(100, 999),
'panes[payment][details][cc_exp_month]' => mt_rand(1, 12),
'panes[payment][details][cc_exp_year]' => mt_rand(date('Y') + 1, 2022),
));
$this
->assertText('Your order is complete!');
}