You are here

public function UbercartCatalogTestCase::testCatalogRepair in Ubercart 7.3

Tests the catalog repair function.

File

uc_catalog/tests/uc_catalog.test, line 37
Tests for the Ubercart catalog.

Class

UbercartCatalogTestCase
Tests for the Ubercart catalog.

Code

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.');
}