In core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php file change static queries to dynamic queries in testUpdateOneBlob() and testUpdateMultipleBlob() methods.
Problem/Motivation
In testUpdateOneBlob()method
$r = $this->connection->query('SELECT * FROM {test_one_blob} WHERE id = :id', [':id' => $id])->fetchAssoc();
In testUpdateMultipleBlob()method
$r = $this->connection->query('SELECT * FROM {test_two_blobs} WHERE id = :id', [':id' => $id])->fetchAssoc();
Proposed resolution
In testUpdateOneBlob()method
$r = \Drupal::database()->select('test_one_blob', 'tob')
->fields('tob')
->condition('id', $id)
->execute()
->fetchAssoc();In testUpdateMultipleBlob()method
$r = \Drupal::database()->select('test_two_blobs', 'ttb')
->fields('ttb')
->condition('id', $id)
->execute()
->fetchAssoc();Remaining tasks
TBD
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3156191-2.patch | 1.36 KB | hardik_patel_12 |
Comments
Comment #2
hardik_patel_12 commentedKindly review the patch.
Comment #3
siddhant.bhosale commentedHi @hardik_patel_12, The patch looks good and applies cleanly, but please refer to the issue https://www.drupal.org/project/drupal/issues/3152398.
It mentions not to change the static queries in the directory
core/tests/Drupal/KernelTests/Core/Database.Please let me know if I am missing anything or we can close the issue.
Comment #4
daffie commentedIn the directory "core/tests/Drupal/KernelTests/Core/Database" are the tests for testing our dynamic queries. That is done by comparing the results of a dynamic query with the results of a static query. The change in this patch will result in testing the results of 2 dynamic queries with each other and that is not what we want. Therefore closing this issue with "will not fix".