You are here

public function XMLSitemapTaxonomyFunctionalTest::testTaxonomySettings in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap_taxonomy/xmlsitemap_taxonomy.test \XMLSitemapTaxonomyFunctionalTest::testTaxonomySettings()

TaxonomySettings.

File

xmlsitemap_taxonomy/xmlsitemap_taxonomy.test, line 57
Unit tests for the xmlsitemap_taxonomy module.

Class

XMLSitemapTaxonomyFunctionalTest
Functional Test.

Code

public function testTaxonomySettings() {
  $this
    ->drupalLogin($this->admin_user);
  $edit = array(
    'name' => $this
      ->randomName(),
    'machine_name' => drupal_strtolower($this
      ->randomName()),
    'xmlsitemap[status]' => '1',
    'xmlsitemap[priority]' => '1.0',
  );
  $this
    ->drupalPost('admin/structure/taxonomy/add', $edit, 'Save');
  $this
    ->assertText("Created new vocabulary {$edit['name']}.");
  $vocabulary = taxonomy_vocabulary_machine_name_load($edit['machine_name']);
  $edit = array(
    'name' => $this
      ->randomName(),
    'xmlsitemap[status]' => 'default',
    'xmlsitemap[priority]' => 'default',
  );
  $this
    ->drupalPost("admin/structure/taxonomy/{$vocabulary->machine_name}/add", $edit, 'Save');
}