Version 1
[yaffs-website] / web / modules / contrib / advagg / src / Tests / AdvaggTestBase.php
diff --git a/web/modules/contrib/advagg/src/Tests/AdvaggTestBase.php b/web/modules/contrib/advagg/src/Tests/AdvaggTestBase.php
new file mode 100644 (file)
index 0000000..f3d6abf
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+
+namespace Drupal\advagg\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * @defgroup advagg_tests Test Suit
+ *
+ * @{
+ * The automated test suit for Advanced Aggregates.
+ *
+ * @}
+ */
+
+/**
+ * Base test class for Advagg test cases.
+ */
+abstract class AdvaggTestBase extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['advagg'];
+
+  /**
+   * A user with permission to administer site configuration.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $user;
+
+  /**
+   * Editable Advagg configuration.
+   *
+   * @var \Drupal\Core\Config\Config
+   */
+  protected $config;
+
+  /**
+   * Editable system configuration.
+   *
+   * @var \Drupal\Core\Config\Config
+   */
+  protected $systemConfig;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->user = $this->drupalCreateUser(['administer site configuration']);
+    $this->drupalLogin($this->user);
+    $this->config = \Drupal::configFactory()->getEditable('advagg.settings');
+
+    // Enable aggregation.
+    $this->systemConfig = \Drupal::configFactory()->getEditable('system.performance');
+    $this->systemConfig->set('css.preprocess', TRUE)
+      ->set('js.preprocess', TRUE)
+      ->save();
+
+  }
+
+}