public function UbercartAttributeTestCase::testAttributeUIAttributeOptionsDelete in Ubercart 6.2
Same name and namespace in other branches
- 7.3 uc_attribute/tests/uc_attribute.test \UbercartAttributeTestCase::testAttributeUIAttributeOptionsDelete()
Tests the "delete attribute option" user interface.
File
- uc_attribute/
uc_attribute.test, line 594 - Ubercart Attribute Tests
Class
- UbercartAttributeTestCase
- SimpleTests for the Ubercart Attributes API.
Code
public function testAttributeUIAttributeOptionsDelete() {
$attribute = self::createAttribute();
$option = self::createAttributeOption(array(
'aid' => $attribute->aid,
));
uc_attribute_option_save($option);
$this
->drupalGet('admin/store/attributes/' . $attribute->aid . '/options/' . $option->oid . '/delete');
$this
->AssertText(t('Are you sure you want to delete the option @name?', array(
'@name' => $option->name,
)), t('Attribute options delete form working.'), t('Ubercart'));
$this
->drupalPost('admin/store/attributes/' . $attribute->aid . '/options/' . $option->oid . '/delete', array(), t('Delete'));
$option = uc_attribute_option_load($option->oid);
$this
->assertFalse($option, t('Attribute option deleted successfully by form'), t('Ubercart'));
}