nextcloud-gpodder/tests/Helper/DatabaseTransaction.php
Matthias Gutjahr cba5bd97c3 Fix typo
2021-11-03 13:51:26 +01:00

25 lines
388 B
PHP

<?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();
}
public function rollbackTransaction() {
/* @var $db IDBConnection */
$db = OC::$server->get(IDBConnection::class);
$db->rollBack();
}
}