| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: ec_product.test,v 1.1.2.1 2009/11/09 11:43:21 gordon Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 33 |
$this->drupalPost('node/add/product/generic', $edit, t('Save')); |
$this->drupalPost('node/add/product/generic', $edit, t('Save')); |
| 34 |
} |
} |
| 35 |
} |
} |
| 36 |
|
|
| 37 |
|
class ecProductTypeCreate extends DrupalWebTestCase { |
| 38 |
|
function getInfo() { |
| 39 |
|
return array( |
| 40 |
|
'name' => t('Product Type Creation'), |
| 41 |
|
'description' => t('Create, Edit and Delete a product type'), |
| 42 |
|
'group' => t('e-Commerce'), |
| 43 |
|
); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
function setUp() { |
| 47 |
|
parent::setUp('ec_common', 'ec_product'); |
| 48 |
|
variable_set('ec_default_currency', 'USD'); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
function testCreateProductType() { |
| 52 |
|
$account = $this->drupalCreateUser(array('create product content', 'administer products')); |
| 53 |
|
$this->drupalLogin($account); |
| 54 |
|
|
| 55 |
|
$edit = array( |
| 56 |
|
'name' => $this->randomName(), |
| 57 |
|
'ptype' => $this->randomName(), |
| 58 |
|
'description' => $this->randomString(255), |
| 59 |
|
); |
| 60 |
|
|
| 61 |
|
$this->drupalPost('admin/ecsettings/products/types/add', $edit, t('Submit product type')); |
| 62 |
|
|
| 63 |
|
$this->assertText('New product type ', t('New product type created')); |
| 64 |
|
|
| 65 |
|
$this->clickLink($edit['name']); |
| 66 |
|
|
| 67 |
|
$edit['description'] = $this->randomName(255); |
| 68 |
|
$this->drupalPost(NULL, $edit, t('Submit product type')); |
| 69 |
|
|
| 70 |
|
$this->assertText('Product type', t('Check for update text')); |
| 71 |
|
} |
| 72 |
|
} |