function UbercartCartCheckoutTestCase::testCustomerInformationCheckoutPane in Ubercart 6.2
Same name and namespace in other branches
- 7.3 uc_cart/tests/uc_cart.test \UbercartCartCheckoutTestCase::testCustomerInformationCheckoutPane()
File
- uc_cart/
uc_cart.test, line 440 - Shopping cart and checkout tests.
Class
- UbercartCartCheckoutTestCase
- Tests the cart and checkout functionality.
Code
function testCustomerInformationCheckoutPane() {
// Log in as a customer and add an item to the cart.
$this
->drupalLogin($this->customer);
$this
->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
$this
->drupalPost('cart', array(), 'Checkout');
// Test the customer information pane.
$mail = $this->customer->mail;
$this
->assertText('Customer information');
$this
->assertText('Order information will be sent to your account e-mail listed below.');
$this
->assertText('E-mail address: ' . $mail);
// Use the 'edit' link to change the email address on the account.
$new_mail = $this
->randomName() . '@example.com';
$this
->clickLink('edit');
$data = array(
'mail' => $new_mail,
);
$this
->drupalPost(NULL, $data, 'Save');
// Test the updated email address.
$this
->assertText('Order information will be sent to your account e-mail listed below.');
$this
->assertNoText('E-mail address: ' . $mail);
$this
->assertText('E-mail address: ' . $new_mail);
}