security update for uuid xmlsitemap file_field_path
This commit is contained in:
@@ -2,19 +2,29 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Unit tests for the xmlsitemap_i18n module.
|
||||
* Unit tests for the xmlsitemap_i18n project.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Common base test class for XML sitemap internationalization tests.
|
||||
*/
|
||||
class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
|
||||
|
||||
/**
|
||||
* Admin User.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @codingStandardsIgnoreStart
|
||||
*/
|
||||
protected $admin_user;
|
||||
|
||||
/**
|
||||
* Set up an administrative user account and testing keys.
|
||||
*
|
||||
* @codingStandardsIgnoreEnd
|
||||
*/
|
||||
function setUp($modules = array()) {
|
||||
public function setUp($modules = array()) {
|
||||
// Call parent::setUp() allowing test cases to pass further modules.
|
||||
$modules[] = 'locale';
|
||||
$modules[] = 'translation';
|
||||
@@ -29,7 +39,8 @@ class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
|
||||
variable_set('language_negotiation', LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX);
|
||||
|
||||
// Create the two different language-context sitemaps.
|
||||
db_query("DELETE FROM {xmlsitemap_sitemap}");
|
||||
db_delete('xmlsitemap_sitemap')->execute();
|
||||
|
||||
$sitemap = new stdClass();
|
||||
$sitemap->context = array('language' => 'en');
|
||||
xmlsitemap_sitemap_save($sitemap);
|
||||
@@ -37,9 +48,17 @@ class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
|
||||
$sitemap->context = array('language' => 'fr');
|
||||
xmlsitemap_sitemap_save($sitemap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* I18n Test.
|
||||
*/
|
||||
class XMLSitemapI18nTest extends XMLSitemapI18nWebTestCase {
|
||||
|
||||
/**
|
||||
* Get Info.
|
||||
*/
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'XML sitemap i18n tests',
|
||||
@@ -49,7 +68,10 @@ class XMLSitemapI18nTest extends XMLSitemapI18nWebTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
function testLanguageSelection() {
|
||||
/**
|
||||
* Language Selection.
|
||||
*/
|
||||
public function testLanguageSelection() {
|
||||
// Create our three different language nodes.
|
||||
$node = $this->addSitemapLink(array('type' => 'node', 'language' => LANGUAGE_NONE));
|
||||
$node_en = $this->addSitemapLink(array('type' => 'node', 'language' => 'en'));
|
||||
@@ -104,9 +126,17 @@ class XMLSitemapI18nTest extends XMLSitemapI18nWebTestCase {
|
||||
$this->assertRawSitemapLinks($node_fr, $link, $link_fr);
|
||||
$this->assertNoRawSitemapLinks($node, $node_en, $link_en);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Node Test.
|
||||
*/
|
||||
class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
|
||||
/**
|
||||
* Get Info.
|
||||
*/
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'XML sitemap i18n node tests',
|
||||
@@ -116,7 +146,10 @@ class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
function setUp($modules = array()) {
|
||||
/**
|
||||
* Setup.
|
||||
*/
|
||||
public function setUp($modules = array()) {
|
||||
$modules[] = 'xmlsitemap_node';
|
||||
parent::setUp($modules);
|
||||
|
||||
@@ -125,7 +158,10 @@ class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
$this->drupalLogin($this->admin_user);
|
||||
}
|
||||
|
||||
function testNodeLanguageData() {
|
||||
/**
|
||||
* Node Language Data.
|
||||
*/
|
||||
public function testNodeLanguageData() {
|
||||
$node = $this->drupalCreateNode(array());
|
||||
|
||||
$this->drupalPost('node/' . $node->nid . '/edit', array('language' => 'en'), t('Save'));
|
||||
@@ -136,4 +172,5 @@ class XMLSitemapI18nNodeTest extends XMLSitemapI18nWebTestCase {
|
||||
$link = $this->assertSitemapLink('node', $node->nid);
|
||||
$this->assertIdentical($link['language'], 'fr');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user