Skip to content

Commit 52a92af

Browse files
committed
add tests that fail?
1 parent f210b4f commit 52a92af

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/Tracing/Doctrine/DBAL/TracingDriverConnectionTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Doctrine\DBAL\Driver\Result as DriverResultInterface;
99
use Doctrine\DBAL\Driver\Statement as DriverStatementInterface;
1010
use Doctrine\DBAL\ParameterType;
11+
use PDO;
1112
use PHPUnit\Framework\MockObject\MockObject;
1213
use Sentry\SentryBundle\Tests\DoctrineTestCase;
1314
use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverConnection;
@@ -396,6 +397,18 @@ public function testGetWrappedConnection(): void
396397
$this->assertSame($this->decoratedConnection, $connection->getWrappedConnection());
397398
}
398399

400+
public function testGetNativeConnection(): void
401+
{
402+
$connection = new TracingDriverConnection($this->hub, $this->decoratedConnection, 'foo_platform', []);
403+
404+
$this->decoratedConnection->expects($this->once())
405+
->method('getNativeConnection')
406+
->willReturn($this->createMock(PDO::class));
407+
408+
$this->assertSame($this->decoratedConnection, $connection->getNativeConnection());
409+
410+
}
411+
399412
/**
400413
* @return \Generator<mixed>
401414
*/

tests/Tracing/Doctrine/DBAL/TracingServerInfoAwareDriverConnectionTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Doctrine\DBAL\Driver\Result;
99
use Doctrine\DBAL\Driver\Statement;
1010
use Doctrine\DBAL\ParameterType;
11+
use PDO;
1112
use PHPUnit\Framework\MockObject\MockObject;
1213
use Sentry\SentryBundle\Tests\DoctrineTestCase;
1314
use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverConnectionInterface;
@@ -256,4 +257,15 @@ public function testGetWrappedConnection(): void
256257

257258
$this->assertSame($wrappedConnection, $this->connection->getWrappedConnection());
258259
}
260+
261+
public function testGetNativeConnection(): void
262+
{
263+
$nativeConnection = $this->createMock(PDO::class);
264+
265+
$this->decoratedConnection->expects($this->once())
266+
->method('getNativeConnection')
267+
->willReturn($nativeConnection);
268+
269+
$this->assertSame($nativeConnection, $this->connection->getWrappedConnection());
270+
}
259271
}

0 commit comments

Comments
 (0)