79 lines
1.8 KiB
Plaintext
79 lines
1.8 KiB
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Unit tests for the xmlsitemap_taxonomy module.
|
|
*/
|
|
|
|
/**
|
|
* Functional Test.
|
|
*/
|
|
class XMLSitemapTaxonomyFunctionalTest extends XMLSitemapTestHelper {
|
|
|
|
/**
|
|
* Normal User.
|
|
*
|
|
* @var string
|
|
*
|
|
* @codingStandardsIgnoreStart
|
|
*/
|
|
protected $normal_user;
|
|
|
|
/**
|
|
* Terms.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $terms = array();
|
|
|
|
/**
|
|
* Get Info.
|
|
*
|
|
* @codingStandardsIgnoreEnd
|
|
*/
|
|
public static function getInfo() {
|
|
return array(
|
|
'name' => 'XML sitemap taxonomy',
|
|
'description' => 'Functional tests for the XML sitemap taxonomy module.',
|
|
'group' => 'XML sitemap',
|
|
);
|
|
}
|
|
|
|
/**
|
|
* SetUp.
|
|
*/
|
|
public function setUp($modules = array()) {
|
|
$modules[] = 'xmlsitemap_taxonomy';
|
|
$modules[] = 'taxonomy';
|
|
parent::setUp($modules);
|
|
|
|
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'administer xmlsitemap'));
|
|
$this->normal_user = $this->drupalCreateUser(array('access content'));
|
|
}
|
|
|
|
/**
|
|
* TaxonomySettings.
|
|
*/
|
|
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');
|
|
}
|
|
|
|
}
|