diff -u b/core/modules/dblog/tests/src/Functional/UpdatePathTest.php b/core/modules/dblog/tests/src/Functional/UpdatePathTest.php --- b/core/modules/dblog/tests/src/Functional/UpdatePathTest.php +++ b/core/modules/dblog/tests/src/Functional/UpdatePathTest.php @@ -2,10 +2,8 @@ namespace Drupal\Tests\dblog\Functional; -use Drupal\Core\Database\Connection; use Drupal\Core\Database\Database; use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\dblog\Logger\DbLog; use Prophecy\PhpUnit\ProphecyTrait; /** @@ -36,28 +34,15 @@ } $this->runUpdates(); - $connection = $this->prophesize(Connection::class); - $connection->getTarget()->willReturn(DbLog::DEDICATED_DBLOG_CONNECTION_TARGET); - // Insert a row with a big value for wid. - $connection->insert('watchdog')->willReturnCallback(function ($table, $fields) { - // Set the 'wid' column of the query to a value which will - // overflow the 32-bit integer limit. - $fields['wid'] = PHP_INT_MAX; - return Database::getConnection()->insert($table)->fields($fields)->execute(); - }); + $insert = Database::getConnection()->insert('watchdog'); + $insert->fields(['wid' => PHP_INT_MAX]); + $insert->execute(); // Insert another row without a value for wid, to test auto-increment. - $connection->insert('watchdog')->willReturnCallback(function ($table, $fields) { - // Do not set the 'wid' column, to test auto-increment. - return Database::getConnection()->insert($table)->fields($fields)->execute(); - }); + $insert = Database::getConnection()->insert('watchdog'); + $insert->execute(); - $this->container->set('database', $connection->reveal()); - - // Generate two log entries: one with a big value for wid, and one without. - $this->generateLogEntries(2); - // Test that the first row exists with the expected value for wid. $result = Database::getConnection()->select('watchdog') ->fields('watchdog', ['wid'])