This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Esun\MultiLocaleTranslation\Test\Unit\Model;
use Esun\MultiLocaleTranslation\Model\LogCleaner;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Adapter\AdapterInterface;
use PHPUnit\Framework\TestCase;
class LogCleanerTest extends TestCase
{
public function testClearsEveryTranslationLogRecord(): void
{
$connection = $this->createMock(AdapterInterface::class);
$connection->expects(self::once())
->method('delete')
->with('esun_localetranslation_log')
->willReturn(504);
$resourceConnection = $this->createMock(ResourceConnection::class);
$resourceConnection->method('getConnection')->willReturn($connection);
$resourceConnection->method('getTableName')->willReturn('esun_localetranslation_log');
self::assertSame(504, (new LogCleaner($resourceConnection))->clearAll());
}
}