123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- * @file
- * Tests for the Ubercart catalog.
- */
- class UbercartCatalogTestCase extends UbercartTestHelper {
- public static function getInfo() {
- return array(
- 'name' => 'Catalog',
- 'description' => 'Ensure that the catalog functions properly.',
- 'group' => 'Ubercart',
- );
- }
- /**
- * Overrides DrupalWebTestCase::setUp().
- */
- protected function setUp($modules = array(), $permissions = array()) {
- $modules = array('uc_catalog', 'field_ui');
- $permissions = array('administer catalog', 'administer content types', 'administer fields');
- parent::setUp($modules, $permissions);
- }
- public function testCatalogRepair() {
- $this->drupalLogin($this->adminUser);
- $this->drupalGet('admin/structure/types/manage/product/fields');
- $this->assertText('taxonomy_catalog', 'Catalog taxonomy term reference field exists.');
- $this->drupalPost('admin/structure/types/manage/product/fields/taxonomy_catalog/delete', array(), t('Delete'));
- $this->assertText('The field Catalog has been deleted from the Product content type.', 'Catalog taxonomy term reference field deleted.');
- $this->drupalGet('admin/structure/types/manage/product/fields');
- $this->assertNoText('taxonomy_catalog', 'Catalog taxonomy term reference field does not exist.');
- $this->drupalGet('admin/store');
- $this->assertText('The catalog taxonomy reference field is missing.', 'Store status message mentions the missing field.');
- $this->drupalGet('admin/store/settings/catalog/repair');
- $this->assertText('The catalog taxonomy reference field has been repaired.', 'Repair message is displayed.');
- $this->drupalGet('admin/structure/types/manage/product/fields');
- $this->assertText('taxonomy_catalog', 'Catalog taxonomy term reference field exists.');
- }
- }
|