Commit 422f1ce9 authored by andrei.dincu's avatar andrei.dincu
Browse files

Issue #2249723 by andrei.dincu: Fix setUp() method in XmlSitemapTestHelper...

Issue #2249723 by andrei.dincu: Fix setUp() method in XmlSitemapTestHelper class and XmlSitemapCustomFunctionalTest class
parent ba4145a3
......@@ -14,10 +14,12 @@ use Drupal\simpletest\WebTestBase;
*/
class XmlSitemapTestHelper extends WebTestBase {
public static $modules = array('xmlsitemap');
protected $admin_user;
public function setUp($modules = array()) {
array_unshift($modules, 'xmlsitemap');
public function setUp() {
array_unshift(self::$modules, 'xmlsitemap');
parent::setUp();
}
......
......@@ -14,6 +14,8 @@ use Drupal\xmlsitemap\Tests\XmlSitemapTestHelper;
*/
class XmlSitemapCustomFunctionalTest extends XmlSitemapTestHelper {
public static $modules = array('xmlsitemap_custom', 'path', 'node');
public static function getInfo() {
return array(
'name' => 'XML sitemap custom interface tests',
......@@ -22,19 +24,18 @@ class XmlSitemapCustomFunctionalTest extends XmlSitemapTestHelper {
);
}
public function setUp($modules = array()) {
$modules[] = 'xmlsitemap_custom';
$modules[] = 'path';
parent::setUp($modules);
public function setUp() {
parent::setUp();
$this->admin_user = $this->drupalCreateUser(array('access content', 'administer xmlsitemap'));
$this->drupalLogin($this->admin_user);
}
public function testCustomLinks() {
$language = \Drupal::languageManager()->getCurrentLanguage();
// Set a path alias for the node page.
$alias = array('source' => 'system/files', 'alias' => 'public-files');
path_save($alias);
\Drupal::service('path.alias_storage')->save('system/files', 'public-files', $language->getId());
$this->drupalGet('admin/config/search/xmlsitemap/custom');
$this->clickLink(t('Add custom link'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment