public function UbercartAttributeTestCase::testAttributeUIClassAttributeAdd in Ubercart 7.3
Same name and namespace in other branches
- 6.2 uc_attribute/uc_attribute.test \UbercartAttributeTestCase::testAttributeUIClassAttributeAdd()
Tests the "add product class attribute option" user interface.
File
- uc_attribute/
tests/ uc_attribute.test, line 583 - Ubercart Attribute Tests.
Class
- UbercartAttributeTestCase
- SimpleTests for the Ubercart Attributes API.
Code
public function testAttributeUIClassAttributeAdd() {
$class = $this
->createProductClass();
$attribute = self::createAttribute();
$this
->drupalGet('admin/store/products/classes/' . $class->pcid . '/attributes/add');
$this
->assertRaw(t('@attribute </label>', array(
'@attribute' => $attribute->name,
)), t('Class attribute add form working.'));
$edit['add_attributes[' . $attribute->aid . ']'] = 1;
$this
->drupalPost('admin/store/products/classes/' . $class->pcid . '/attributes/add', $edit, t('Add attributes'));
$this
->assertNoText(t('You must first add attributes to this class.'), t('Class attribute form working.'));
}