public function AbstractAutocompleteSynonymsWebTestCase::setUp in Synonyms 7
SetUp method.
Overrides SynonymsWebTestCase::setUp
3 calls to AbstractAutocompleteSynonymsWebTestCase::setUp()
- CommerceProductReferenceAutocompleteSynonymsWebTestCase::setUp in synonyms_commerce/
synonyms_commerce.test - SetUp method.
- EntityReferenceAutocompleteSynonymsWebTestCase::setUp in ./
synonyms.test - SetUp method.
- TaxonomyTermReferenceAutocompleteSynonymsWebTestCase::setUp in ./
synonyms.test - SetUp method.
3 methods override AbstractAutocompleteSynonymsWebTestCase::setUp()
- CommerceProductReferenceAutocompleteSynonymsWebTestCase::setUp in synonyms_commerce/
synonyms_commerce.test - SetUp method.
- EntityReferenceAutocompleteSynonymsWebTestCase::setUp in ./
synonyms.test - SetUp method.
- TaxonomyTermReferenceAutocompleteSynonymsWebTestCase::setUp in ./
synonyms.test - SetUp method.
File
- ./
synonyms.test, line 392 - Tests for the Synonyms module.
Class
- AbstractAutocompleteSynonymsWebTestCase
- Test "Synonyms friendly autocomplete" widget of Synonyms module.
Code
public function setUp($modules = array()) {
$this->behavior_implementation['behavior'] = 'autocomplete';
$this->behavior_implementation['settings'] = array(
'wording' => '@synonym @field_name @entity @bundle',
);
$modules[] = 'synonyms_provider_property';
parent::setUp($modules);
// We'll also enable the ID property to be source of synonyms so we can
// extra test multiple providers at the same time.
$behavior_implementation = $this->behavior_implementation;
$entity_info = entity_get_info($behavior_implementation['entity_type']);
$behavior_implementation['provider'] = synonyms_provider_property_provider_name($entity_info['entity keys']['id']);
synonyms_behavior_implementation_save($behavior_implementation);
// Creating a test content type.
$this
->drupalPost('admin/structure/types/add', array(
'name' => 'Synonyms Test Content',
'type' => $this->bundle,
), 'Save content type');
drupal_static_reset();
$this
->createTerms();
}