nextcloud-gpodder/tests/Helper/DatabaseTransaction.php

25 lines
388 B
PHP
Raw Normal View History

<?php
namespace tests\Helper;
use OC;
use OCP\IDBConnection;
trait DatabaseTransaction {
public function startTransaction() {
/* @var $db IDBConnection */
$db = OC::$server->get(IDBConnection::class);
$db->beginTransaction();
}
2021-10-18 10:36:22 +02:00
public function rollbackTransaction() {
/* @var $db IDBConnection */
$db = OC::$server->get(IDBConnection::class);
$db->rollBack();
}
}