public function testFindCallerFromDebugBacktrace() { Database::
addConnectionInfo('default', 'default',
[ 'driver' => 'test',
'namespace' => 'Drupal\Tests\Core\Database\Stub',
]);
$connection =
new StubConnection($this->
createMock(StubPDO::
class),
[]);
$result =
$connection->
findCallerFromDebugBacktrace();
$this->
assertSame([ 'file' => __FILE__,
'line' => 660,
'function' => 'testFindCallerFromDebugBacktrace',
'class' => 'Drupal\Tests\Core\Database\ConnectionTest',
'type' => '->',
'args' =>
[],
],
$result);
} /**
* Tests that a log called by a custom database driver returns proper caller.
*
* @param string $driver_namespace
* The driver namespace to be tested.
* @param array $stack
* A test debug_backtrace stack.
* @param array $expected_entry
* The expected stack entry.
*
* @covers ::findCallerFromDebugBacktrace
* @covers ::removeDatabaseEntriesFromDebugBacktrace
*
* @dataProvider providerMockedBacktrace
*
* @group legacy
*/