Skip to content
Snippets Groups Projects

Non cache tables starting with cache_

2 files
+ 18
1
Compare changes
  • Side-by-side
  • Inline

Files

@@ -95,6 +95,17 @@ public function testUpdate() {
$this->markTestSkipped("This test does not support the SQLite database driver.");
}
// Create a table starting with cache that is not a cache bin.
\Drupal::service('database')->schema()->createTable('cache_bogus', [
'fields' => [
'id' => [
'type' => 'int',
'not null' => TRUE,
],
],
'primary key' => ['id'],
]);
$this->collectTimestampFieldsFromDatabase();
// PostgreSQL returns the value 'integer' instead of 'int' when queried
// about the column type. Some PostgreSQL tables are already of the type
@@ -120,7 +131,7 @@ public function collectTimestampFieldsFromDatabase() {
}
$tables = $connection->schema()->findTables('cache_%');
$tables = array_filter($tables, function ($table) {
return str_starts_with($table, 'cache_');
return str_starts_with($table, 'cache_') && $table !== 'cache_bogus';
});
$this->assertNotEmpty($tables);
foreach ($tables as $table) {
Loading