Commit 3212c3bb authored by andrei.dincu's avatar andrei.dincu
Browse files

Issue #2249723 by andrei.dincu: XMlSitemapFunctionalTest passes all tests

parent 66c5df53
......@@ -12,7 +12,7 @@ namespace Drupal\xmlsitemap\Tests;
*/
class XmlSitemapFunctionalTest extends XmlSitemapTestBase {
public static $modules = array('xmlsitemap', 'path', 'node', 'system', 'user', 'help', 'menu_test');
public static $modules = array('xmlsitemap', 'path', 'node', 'system', 'user', 'help', 'block');
protected $state;
protected $config;
......@@ -30,6 +30,7 @@ class XmlSitemapFunctionalTest extends XmlSitemapTestBase {
$this->admin_user = $this->drupalCreateUser(array('access content', 'administer site configuration', 'administer xmlsitemap', 'access administration pages', 'access site reports', 'administer permissions', 'view the administration theme'));
$this->state = \Drupal::state();
$this->config = \Drupal::configFactory()->get('xmlsitemap.settings');
$this->drupalPlaceBlock('system_help_block', array('region' => 'help'));
}
/**
......@@ -82,8 +83,6 @@ class XmlSitemapFunctionalTest extends XmlSitemapTestBase {
$this->drupalLogin($this->admin_user);
$this->state->set('xmlsitemap_generated_last', REQUEST_TIME);
$this->state->set('xmlsitemap_rebuild_needed', TRUE);
$this->drupalGet('admin/config/search/xmlsitemap/rebuild');
$this->assertText("This action rebuilds your site's XML sitemap and regenerates the cached files, and may be a lengthy process. If you just installed XML sitemap, this can be helpful to import all your site's content into the sitemap. Otherwise, this should only be used in emergencies.");
$this->assertXMLSitemapProblems(t('The XML sitemap data is out of sync and needs to be completely rebuilt.'));
$this->clickLink(t('completely rebuilt'));
$this->assertResponse(200);
......
......@@ -222,6 +222,7 @@ abstract class XmlSitemapTestBase extends WebTestBase {
$this->drupalGet('admin/config/search/xmlsitemap');
$this->assertText(t('One or more problems were detected with your XML sitemap configuration'));
if ($problem_text) {
$this->clickLink(t('status report'));
$this->assertText($problem_text);
}
}
......
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