You are here

public function UbercartAttributeTestCase::testAttributeUIDeleteAttribute in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_attribute/uc_attribute.test \UbercartAttributeTestCase::testAttributeUIDeleteAttribute()

Tests the "delete attribute" user interface.

File

uc_attribute/tests/uc_attribute.test, line 423
Ubercart Attribute Tests.

Class

UbercartAttributeTestCase
SimpleTests for the Ubercart Attributes API.

Code

public function testAttributeUIDeleteAttribute() {
  $attribute = self::createAttribute();
  $this
    ->drupalGet('admin/store/products/attributes/' . $attribute->aid . '/delete');
  $this
    ->assertText(t('Are you sure you want to delete the attribute @name?', array(
    '@name' => $attribute->name,
  )), t('Attribute delete form working.'));
  $edit = (array) self::createAttribute();
  unset($edit['aid']);
  $this
    ->drupalPost('admin/store/products/attributes/' . $attribute->aid . '/delete', array(), t('Delete'));
  $this
    ->assertText(t('Product attribute deleted.'), t('Attribute deleted properly.'));
}