X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Ftests%2FDrupal%2FKernelTests%2FCore%2FDatabase%2FInsertTest.php;fp=web%2Fcore%2Ftests%2FDrupal%2FKernelTests%2FCore%2FDatabase%2FInsertTest.php;h=d6b0f8dd80df34993e34961c7092e40f0081bcbf;hp=3812151babd49cd8f2ed419015ee7664b47dd7ab;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php b/web/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php index 3812151ba..d6b0f8dd8 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php @@ -198,14 +198,20 @@ class InsertTest extends DatabaseTestBase { * Tests that we can INSERT INTO a special named column. */ public function testSpecialColumnInsert() { - $id = db_insert('test_special_columns') + $this->connection->insert('test_special_columns') ->fields([ 'id' => 2, 'offset' => 'Offset value 2', + 'function' => 'foobar', ]) ->execute(); - $saved_value = db_query('SELECT "offset" FROM {test_special_columns} WHERE id = :id', [':id' => 2])->fetchField(); - $this->assertIdentical($saved_value, 'Offset value 2', 'Can retrieve special column name value after inserting.'); + $result = $this->connection->select('test_special_columns') + ->fields('test_special_columns', ['offset', 'function']) + ->condition('test_special_columns.function', 'foobar') + ->execute(); + $record = $result->fetch(); + $this->assertSame('Offset value 2', $record->offset); + $this->assertSame('foobar', $record->function); } }