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

Issue #2249723 by andrei.dincu: Replace variable_set() with D8 code in...

Issue #2249723 by andrei.dincu: Replace variable_set() with D8 code in XmlSitemapUnitTest and XmlSitemapTestHelper
parent 3e150d2e
......@@ -200,7 +200,7 @@ class XmlSitemapTestHelper extends WebTestBase {
$value = xmlsitemap_var($variable);
if ($reset_if_true && $value) {
variable_set('xmlsitemap_' . $variable, FALSE);
\Drupal::config('xmlsitemap.settings')->set($variable, FALSE);
}
return $this->assertEqual($value, $assert_value, "xmlsitemap_$variable is " . ($assert_value ? 'TRUE' : 'FALSE'));
......
......@@ -23,7 +23,7 @@ class XmlSitemapUnitTest extends XmlSitemapTestHelper {
}
public function testAssertFlag() {
variable_set('xmlsitemap_rebuild_needed', TRUE);
\Drupal::config('xmlsitemap.settings')->set('rebuild_needed', TRUE);
$this->assertTrue(xmlsitemap_var('rebuild_needed'));
$this->assertTrue($this->assertFlag('rebuild_needed', TRUE, FALSE));
$this->assertTrue(xmlsitemap_var('rebuild_needed'));
......@@ -72,7 +72,7 @@ class XmlSitemapUnitTest extends XmlSitemapTestHelper {
*/
public function testGetChunkCount() {
// Set a low chunk size for testing.
variable_set('xmlsitemap_chunk_size', 4);
\Drupal::config('xmlsitemap.settings')->set('chunk_size', 4);
// Make the total number of links just equal to the chunk size.
$count = db_query("SELECT COUNT(id) FROM {xmlsitemap}")->fetchField();
......
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