diff --git a/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php b/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php index c7c3ab5d0d83374b3d134d9b29390a2a7df45f1e..e9d18a0ce4d5a443ce9da835a7f4ca388e4cb47d 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php @@ -4,6 +4,7 @@ use Drupal\Core\Database\Query\Condition; use Drupal\Core\Database\Query\Delete; +use Drupal\Core\Database\Query\Merge; use Drupal\Core\Database\Query\Update; use Drupal\Core\Database\Transaction; use Drupal\Core\Database\Database; @@ -196,16 +197,7 @@ public function testDbCreateTable() { * @expectedDeprecation db_merge() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call merge() on it. For example, $injected_database->merge($table, $options). See https://www.drupal.org/node/2993033 */ public function testDbMerge() { - $num_records_before = (int) $this->connection->select('test_people')->countQuery()->execute()->fetchField(); - $result = db_merge('test_people') - ->key('job', 'Presenter') - ->fields([ - 'age' => 31, - 'name' => 'Tiffany', - ]) - ->execute(); - $num_records_after = (int) $this->connection->select('test_people')->countQuery()->execute()->fetchField(); - $this->assertSame($num_records_before + 1, $num_records_after, 'Merge inserted properly.'); + $this->assertInstanceOf(Merge::class, db_merge('test')); } /**