Commit a402e9fc authored by andrei.dincu's avatar andrei.dincu
Browse files

Issue #2249723 by andrei.dincu: Move XmlSitemapTestHelper to...

Issue #2249723 by andrei.dincu: Move XmlSitemapTestHelper to XmlSitemapTestBase, add phpdoc for some test classes and make helper test classes abstract
parent e9417cd1
......@@ -7,12 +7,10 @@
namespace Drupal\xmlsitemap\Tests;
use Drupal\xmlsitemap\Tests\XmlSitemapTestHelper;
/**
* Tests the generation of sitemaps.
*/
class XmlSitemapFunctionalTest extends XmlSitemapTestHelper {
class XmlSitemapFunctionalTest extends XmlSitemapTestBase {
public static $modules = array('xmlsitemap', 'path', 'node', 'system');
......
......@@ -9,6 +9,9 @@ namespace Drupal\xmlsitemap\Tests;
use Drupal\Core\Language\LanguageInterface;
/**
* Tests the generation of multilingual nodes.
*/
class XmlSitemapI18nNodeTest extends XmlSitemapI18nWebTestCase {
public static $modules = array('xmlsitemap', 'language', 'content_translation', 'node');
......
......@@ -9,6 +9,9 @@ namespace Drupal\xmlsitemap\Tests;
use Drupal\Core\Language\LanguageInterface;
/**
* Tests the generation of multilingual sitemaps.
*/
class XmlSitemapI18nTest extends XmlSitemapI18nWebTestCase {
public static function getInfo() {
......
......@@ -12,7 +12,7 @@ use Drupal\Core\Language\LanguageInterface;
/**
* Common base test class for XML sitemap internationalization tests.
*/
class XmlSitemapI18nWebTestCase extends XmlSitemapTestHelper {
abstract class XmlSitemapI18nWebTestCase extends XmlSitemapTestBase {
protected $admin_user;
public static $modules = array('language', 'xmlsitemap', 'locale');
......@@ -44,9 +44,5 @@ class XmlSitemapI18nWebTestCase extends XmlSitemapTestHelper {
$sitemap->context = array('language' => 'fr');
xmlsitemap_sitemap_save($sitemap);
}
public function testMe() {
}
}
......@@ -12,7 +12,7 @@ use Drupal\system\Entity\Menu;
/**
* Tests the generation of menu links.
*/
class XmlSitemapMenuFunctionalTest extends XmlSitemapTestHelper {
class XmlSitemapMenuFunctionalTest extends XmlSitemapTestBase {
protected $normal_user;
protected $menu_items = array();
......
......@@ -12,7 +12,7 @@ use Drupal\Core\Language\LanguageInterface;
/**
* Tests the generation of user links.
*/
class XmlSitemapNodeFunctionalTest extends XmlSitemapTestHelper {
class XmlSitemapNodeFunctionalTest extends XmlSitemapTestBase {
public static $modules = array('node', 'xmlsitemap');
protected $normal_user;
......@@ -51,12 +51,12 @@ class XmlSitemapNodeFunctionalTest extends XmlSitemapTestHelper {
\Drupal::config('xmlsitemap.settings')->set('xmlsitemap_entity_node_bundle_article', 1);
\Drupal::config('xmlsitemap.settings')->set('xmlsitemap_entity_node_bundle_page', 1);
\Drupal::config('xmlsitemap.settings')->save();
xmlsitemap_link_bundle_settings_save('node', 'page', array('status' => TRUE, 'priority' => 0.6));
xmlsitemap_link_bundle_settings_save('node', 'page', array('status' => 1, 'priority' => 0.6));
}
public function testNodeSettings() {
$node = $this->drupalCreateNode(array('publish' => 0, 'uid' => $this->normal_user->id()));
$this->assertSitemapLinkValues('node', $node->id(), array('access' => 1, 'status' => TRUE, 'priority' => 0.6, 'status_override' => 0, 'priority_override' => 0));
$this->assertSitemapLinkValues('node', $node->id(), array('access' => 1, 'status' => 1, 'priority' => 0.6, 'status_override' => 0, 'priority_override' => 0));
$this->drupalLogin($this->normal_user);
$this->drupalGet('node/' . $node->id() . '/edit');
......
......@@ -7,12 +7,10 @@
namespace Drupal\xmlsitemap\Tests;
use Drupal\xmlsitemap\Tests\XmlSitemapTestHelper;
/**
* Tests the robots.txt file existance.
*/
class XmlSitemapRobotsTxtIntegrationTest extends XmlSitemapTestHelper {
class XmlSitemapRobotsTxtIntegrationTest extends XmlSitemapTestBase {
public static $modules = array('xmlsitemap', 'robotstxt');
......
......@@ -12,7 +12,7 @@ use Drupal\Core\Language\LanguageInterface;
/**
* Tests the generation of taxonomy links.
*/
class XmlSitemapTaxonomyFunctionalTest extends XmlSitemapTestHelper {
class XmlSitemapTaxonomyFunctionalTest extends XmlSitemapTestBase {
public static $modules = array('taxonomy', 'xmlsitemap');
protected $normal_user;
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\xmlsitemap\Tests\XmlSitemapTestHelper.
* Definition of Drupal\xmlsitemap\Tests\XmlSitemapTestBase.
*/
namespace Drupal\xmlsitemap\Tests;
......@@ -12,7 +12,7 @@ use Drupal\simpletest\WebTestBase;
/**
* Helper test class with some added functions for testing.
*/
class XmlSitemapTestHelper extends WebTestBase {
abstract class XmlSitemapTestBase extends WebTestBase {
public static $modules = array('xmlsitemap');
......
......@@ -7,12 +7,10 @@
namespace Drupal\xmlsitemap\Tests;
use Drupal\xmlsitemap\Tests\XmlSitemapTestHelper;
/**
* Unit testing class for xmlsitemap.
*/
class XmlSitemapUnitTest extends XmlSitemapTestHelper {
class XmlSitemapUnitTest extends XmlSitemapTestBase {
public static $modules = array('xmlsitemap', 'node', 'system');
......
......@@ -10,7 +10,7 @@ namespace Drupal\xmlsitemap\Tests;
/**
* Tests the generation of user links.
*/
class XmlSitemapUserFunctionalTest extends XmlSitemapTestHelper {
class XmlSitemapUserFunctionalTest extends XmlSitemapTestBase {
protected $normal_user;
protected $accounts = array();
......
......@@ -7,12 +7,12 @@
namespace Drupal\xmlsitemap_custom\Tests;
use Drupal\xmlsitemap\Tests\XmlSitemapTestHelper;
use Drupal\xmlsitemap\Tests\XmlSitemapTestBase;
/**
* Tests the functionality of xmlsitemap_custom module.
*/
class XmlSitemapCustomFunctionalTest extends XmlSitemapTestHelper {
class XmlSitemapCustomFunctionalTest extends XmlSitemapTestBase {
public static $modules = array('xmlsitemap_custom', 'path', 'node');
......
......@@ -7,12 +7,12 @@
namespace Drupal\xmlsitemap_engines\Tests;
use Drupal\xmlsitemap\Tests\XmlSitemapTestHelper;
use Drupal\xmlsitemap\Tests\XmlSitemapTestBase;
/**
* Test xmlsitemap_engines functionality.
*/
class XmlSitemapEnginesFunctionalTest extends XmlSitemapTestHelper {
class XmlSitemapEnginesFunctionalTest extends XmlSitemapTestBase {
protected $submit_url;
public static $modules = array('system', 'path', 'node', 'dblog', 'xmlsitemap', 'xmlsitemap_engines', 'xmlsitemap_engines_test');
......
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