You are here

protected function FieldSchemaDataUninstallUpdateTest::assertFieldSchemaData in Drupal 8

Asserts that field schema data to be purged is found.

Parameters

bool $found: Whether field schema data is expected to be found or not.

string $message: The assert message.

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

1 call to FieldSchemaDataUninstallUpdateTest::assertFieldSchemaData()
FieldSchemaDataUninstallUpdateTest::testUpdateHookN in core/modules/system/tests/src/Functional/Update/FieldSchemaDataUninstallUpdateTest.php
Tests the upgrade path after fixing field schema data uninstallation.

File

core/modules/system/tests/src/Functional/Update/FieldSchemaDataUninstallUpdateTest.php, line 53

Class

FieldSchemaDataUninstallUpdateTest
Tests the upgrade path after fixing field schema data uninstallation.

Namespace

Drupal\Tests\system\Functional\Update

Code

protected function assertFieldSchemaData($found, $message) {
  $query = \Drupal::database()
    ->select('key_value', 'kv')
    ->fields('kv');
  $query
    ->condition('kv.collection', 'entity.storage_schema.sql')
    ->condition('kv.name', 'block_content.field_schema_data.%', 'LIKE');
  $items = $query
    ->execute()
    ->fetchAll();
  return $this
    ->assertEqual((bool) $items, $found, $message);
}