function InsertLobTest::testInsertMultipleBlob

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php \Drupal\KernelTests\Core\Database\InsertLobTest::testInsertMultipleBlob()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php \Drupal\KernelTests\Core\Database\InsertLobTest::testInsertMultipleBlob()
  3. 10 core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php \Drupal\KernelTests\Core\Database\InsertLobTest::testInsertMultipleBlob()

Tests that we can insert multiple blob fields in the same query.

File

core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php, line 41

Class

InsertLobTest
Tests the Insert query builder with LOB fields.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testInsertMultipleBlob() : void {
    $id = $this->connection
        ->insert('test_two_blobs')
        ->fields([
        'blob1' => 'This is',
        'blob2' => 'a test',
    ])
        ->execute();
    $r = $this->connection
        ->query('SELECT * FROM {test_two_blobs} WHERE [id] = :id', [
        ':id' => $id,
    ])
        ->fetchAssoc();
    $this->assertSame('This is', $r['blob1']);
    $this->assertSame('a test', $r['blob2']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.