Version 1
[yaffs-website] / web / core / modules / system / src / Tests / Update / AutomatedCronUpdateWithoutAutomatedCronTest.php
diff --git a/web/core/modules/system/src/Tests/Update/AutomatedCronUpdateWithoutAutomatedCronTest.php b/web/core/modules/system/src/Tests/Update/AutomatedCronUpdateWithoutAutomatedCronTest.php
new file mode 100644 (file)
index 0000000..9f76ebd
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\system\Tests\Update;
+
+/**
+ * Ensures that the automated cron module is not installed on update.
+ *
+ * @group Update
+ */
+class AutomatedCronUpdateWithoutAutomatedCronTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
+      __DIR__ . '/../../../tests/fixtures/update/drupal-8.without_automated_cron.php',
+    ];
+  }
+
+  /**
+   * Ensures that automated cron module isn't installed and the config migrated.
+   */
+  public function testUpdate() {
+    $this->runUpdates();
+    $module_data = \Drupal::config('core.extension')->get('module');
+    $this->assertFalse(isset($module_data['automated_cron']), 'The automated cron module was not installed.');
+  }
+
+}