chore(tests): cleanup previews in teardown

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/55870/head
Ferdinand Thiessen 2025-10-21 03:40:04 +07:00
parent 1eeed0a170
commit b2ffff385a
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
2 changed files with 8 additions and 0 deletions

@ -24,6 +24,7 @@ class PreviewMapperTest extends TestCase {
private IGenerator $snowflake; private IGenerator $snowflake;
public function setUp(): void { public function setUp(): void {
parent::setUp();
$this->previewMapper = Server::get(PreviewMapper::class); $this->previewMapper = Server::get(PreviewMapper::class);
$this->connection = Server::get(IDBConnection::class); $this->connection = Server::get(IDBConnection::class);
$this->snowflake = Server::get(IGenerator::class); $this->snowflake = Server::get(IGenerator::class);
@ -38,6 +39,11 @@ class PreviewMapperTest extends TestCase {
$qb->delete('previews')->executeStatement(); $qb->delete('previews')->executeStatement();
} }
public function tearDown(): void {
$this->previewMapper->deleteAll();
parent::tearDown();
}
public function testGetAvailablePreviews(): void { public function testGetAvailablePreviews(): void {
// Empty // Empty
$this->assertEquals([], $this->previewMapper->getAvailablePreviews([])); $this->assertEquals([], $this->previewMapper->getAvailablePreviews([]));

@ -25,6 +25,7 @@ class PreviewServiceTest extends TestCase {
private IGenerator $snowflakeGenerator; private IGenerator $snowflakeGenerator;
protected function setUp(): void { protected function setUp(): void {
parent::setUp();
$this->previewService = Server::get(PreviewService::class); $this->previewService = Server::get(PreviewService::class);
$this->previewMapper = Server::get(PreviewMapper::class); $this->previewMapper = Server::get(PreviewMapper::class);
$this->snowflakeGenerator = Server::get(IGenerator::class); $this->snowflakeGenerator = Server::get(IGenerator::class);
@ -33,6 +34,7 @@ class PreviewServiceTest extends TestCase {
public function tearDown(): void { public function tearDown(): void {
$this->previewService->deleteAll(); $this->previewService->deleteAll();
parent::tearDown();
} }
public function testGetAvailableFileIds(): void { public function testGetAvailableFileIds(): void {