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()); } }