Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / system / src / Tests / Module / ModuleTestBase.php
index a0a4ed226a925bd8351af0ac46f5e8fd3c9637d1..257bb879cf77000bfc8d03ae0fb2e10291daf5d5 100644 (file)
@@ -59,8 +59,9 @@ abstract class ModuleTestBase extends WebTestBase {
   public function assertModuleTablesExist($module) {
     $tables = array_keys(drupal_get_module_schema($module));
     $tables_exist = TRUE;
+    $schema = Database::getConnection()->schema();
     foreach ($tables as $table) {
-      if (!db_table_exists($table)) {
+      if (!$schema->tableExists($table)) {
         $tables_exist = FALSE;
       }
     }
@@ -76,8 +77,9 @@ abstract class ModuleTestBase extends WebTestBase {
   public function assertModuleTablesDoNotExist($module) {
     $tables = array_keys(drupal_get_module_schema($module));
     $tables_exist = FALSE;
+    $schema = Database::getConnection()->schema();
     foreach ($tables as $table) {
-      if (db_table_exists($table)) {
+      if ($schema->tableExists($table)) {
         $tables_exist = TRUE;
       }
     }
@@ -90,8 +92,10 @@ abstract class ModuleTestBase extends WebTestBase {
    * @param string $module
    *   The name of the module.
    *
-   * @return bool
-   *   TRUE if configuration has been installed, FALSE otherwise.
+   * @return bool|null
+   *   TRUE if configuration has been installed, FALSE otherwise. Returns NULL
+   *   if the module configuration directory does not exist or does not contain
+   *   any configuration files.
    */
   public function assertModuleConfig($module) {
     $module_config_dir = drupal_get_path('module', $module) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;