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

Skip to content

Commit c40af2d

Browse files
[Messenger] Use :memory: for SQLite tests
1 parent 33fb71b commit c40af2d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,17 @@ class DoctrineIntegrationTest extends TestCase
2828
private $driverConnection;
2929
/** @var Connection */
3030
private $connection;
31-
/** @var string */
32-
private $sqliteFile;
3331

3432
protected function setUp(): void
3533
{
36-
$this->sqliteFile = sys_get_temp_dir().'/symfony.messenger.sqlite';
37-
$dsn = getenv('MESSENGER_DOCTRINE_DSN') ?: 'sqlite:///'.$this->sqliteFile;
34+
$dsn = getenv('MESSENGER_DOCTRINE_DSN') ?: 'sqlite://:memory:';
3835
$this->driverConnection = DriverManager::getConnection(['url' => $dsn]);
3936
$this->connection = new Connection([], $this->driverConnection);
4037
}
4138

4239
protected function tearDown(): void
4340
{
4441
$this->driverConnection->close();
45-
if (file_exists($this->sqliteFile)) {
46-
@unlink($this->sqliteFile);
47-
}
4842
}
4943

5044
public function testConnectionSendAndGet()

0 commit comments

Comments
 (0)