t('eMail Update'), 'description' => t('Check that when updating the order the email for anonymous customers is retained.'), 'group' => t('e-Commerce'), ); } function setUp() { parent::setUp('ec_product', 'ec_anon', 'ec_buynow', 'ec_cart', 'ec_customer', 'ctools', 'ec_checkout', 'ec_store', 'ec_common'); } function testAnonUserPurchase() { $product = array( 'type' => 'product', 'ptype' => 'generic', 'price' => '20.00', ); $node = $this->drupalCreateNode($product); $this->drupalGet('node/' . $node->nid); $this->clickLink(t('Buy now')); $params = array('mail' => $this->randomName() . '@example.com'); $this->drupalPost(NULL, $params, t('Update order')); $this->assertFieldByName('mail', $params['mail']); } } class ecCustomerTestUpdateShippable extends DrupalWebTestCase { function getInfo() { return array( 'name' => t('Update address on shippable products'), 'description' => t('Check that using the \'Use this address as the shipping address\' on checkout will not cause errors on update/checkout'), 'group' => t('e-Commerce'), ); } function setUp() { parent::setUp('ec_product', 'ec_anon', 'ec_checkout', 'ec_buynow', 'ec_receipt', 'ec_store', 'ec_common', 'ec_receipt_test_payment', 'ec_customer', 'ec_address', 'search', 'ctools', 'rules', 'views'); variable_set('ec_default_currency', 'USD'); variable_set('rules_debug', 1); $info = ec_product_get_types('type', 'tangible'); ec_product_feature_enable($info, 'shippable'); } function testTangiblePurchase() { $account = $this->drupalCreateUser(); $this->drupalLogin($account); $product = array( 'type' => 'product', 'ptype' => 'tangible', 'price' => '20.00', 'revision' => 1, ); $node = $this->drupalCreateNode($product); $this->drupalGet('node/'. $node->nid); $this->clickLink(t('Buy now')); $params = array(); foreach (array( 'firstname' => $this->randomName(20), 'lastname' => $this->randomName(20), 'street1' => $this->randomName(52), 'street2' => $this->randomName(52), 'zip' => drupal_substr($this->randomName(10), -10), 'city' => $this->randomName(20), 'state' => 'CA', 'country' => 'US', ) as $key => $value) { $params['address[billing]['. $key .']'] = $value; } $params['address[billing][use_for_shipping]'] = 1; $this->drupalPost(NULL, $params, t('Update order')); $this->assertNoText('Shipping First name field is required.', 'Required field shipping first name field has caused form error'); $this->assertNoText('Shipping Last name field is required.', 'Required field shipping last name field has caused form error'); $this->assertNoText('Shipping Street field is required.', 'Required field shipping street field has caused form error'); $this->assertNoText('Shipping City field is required.', 'Required field shipping city field has caused form error'); } }