Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b43ce2a

Browse files
Skip tests when no Doctrine is available
1 parent 3929cc7 commit b43ce2a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/Symfony/Component/Messenger/Tests/Transport/ConnectionTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class ConnectionTest extends TestCase
2424
{
2525
public function testTableNotFoundExceptionWithEnabledAutoSetup()
2626
{
27+
if (!class_exists(DBALConnection::class)) {
28+
$this->markTestSkipped('Unable to run this test without Doctrine');
29+
}
30+
2731
$dbalConnection = $this->getDbalConnectionMock(TableNotFoundException::class);
2832
$transportConnection = $this->getMockBuilder(Connection::class)
2933
->setConstructorArgs([['auto_setup' => true], $dbalConnection])
@@ -39,6 +43,10 @@ public function testTableNotFoundExceptionWithEnabledAutoSetup()
3943

4044
public function testTableNotFoundExceptionWithDisabledAutoSetup()
4145
{
46+
if (!class_exists(DBALConnection::class)) {
47+
$this->markTestSkipped('Unable to run this test without Doctrine');
48+
}
49+
4250
$dbalConnection = $this->getDbalConnectionMock(TableNotFoundException::class);
4351
$transportConnection = $this->getMockBuilder(Connection::class)
4452
->setConstructorArgs([['auto_setup' => false], $dbalConnection])
@@ -54,6 +62,10 @@ public function testTableNotFoundExceptionWithDisabledAutoSetup()
5462

5563
public function testDriverException()
5664
{
65+
if (!class_exists(DBALConnection::class)) {
66+
$this->markTestSkipped('Unable to run this test without Doctrine');
67+
}
68+
5769
$dbalConnection = $this->getDbalConnectionMock(DriverException::class);
5870
$transportConnection = $this->getMockBuilder(Connection::class)
5971
->setConstructorArgs([['auto_setup' => false], $dbalConnection])

0 commit comments

Comments
 (0)