1 database_test.test DatabaseInsertLOBTestCase::testInsertMultipleBlob()

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

File

core/modules/simpletest/tests/database_test.test, line 634
Database tests.

Class

DatabaseInsertLOBTestCase
Insert tests using LOB fields, which are weird on some databases.

Code

function testInsertMultipleBlob() {
  $id = db_insert('test_two_blobs')
    ->fields(array(
      'blob1' => 'This is',
      'blob2' => 'a test',
    ))
    ->execute();
  $r = db_query('SELECT * FROM {test_two_blobs} WHERE id = :id', array(':id' => $id))->fetchAssoc();
  $this->assertTrue($r['blob1'] === 'This is' && $r['blob2'] === 'a test', 'Can insert multiple blobs per row.');
}