diff options
author | Marvin Borner | 2018-06-28 21:15:57 +0200 |
---|---|---|
committer | Marvin Borner | 2018-06-28 21:15:57 +0200 |
commit | 15793496e8d56769c792cf39673c6e6dea3ec4d9 (patch) | |
tree | 1038f86603cdb52d7d9be5f125e5a88a25086995 /main/app/tests/DatabaseTransactions.php | |
parent | 8781338896a0cfb47c871a0ecb13cd3fdee09d8e (diff) |
Preparing for complete rewrite..
Diffstat (limited to 'main/app/tests/DatabaseTransactions.php')
-rw-r--r-- | main/app/tests/DatabaseTransactions.php | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/main/app/tests/DatabaseTransactions.php b/main/app/tests/DatabaseTransactions.php deleted file mode 100644 index 2155c6a..0000000 --- a/main/app/tests/DatabaseTransactions.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php
-/**
- * UserFrosting (http://www.userfrosting.com)
- *
- * @link https://github.com/userfrosting/UserFrosting
- * @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License)
- */
-namespace UserFrosting\Tests;
-
-/**
- * Trait enabling wrapping of each test case in a database transaction
- * Based on Laravel `DatabaseTransactions` Traits
- *
- * @author Louis Charette
- */
-trait DatabaseTransactions
-{
- /**
- * Handle database transactions on the specified connections.
- *
- * @return void
- */
- public function beginDatabaseTransaction()
- {
- $database = $this->ci['db'];
-
- foreach ($this->connectionsToTransact() as $name) {
- $database->connection($name)->beginTransaction();
- }
-
- $this->beforeApplicationDestroyed(function () use ($database) {
- foreach ($this->connectionsToTransact() as $name) {
- $database->connection($name)->rollBack();
- }
- });
- }
-
- /**
- * The database connections that should have transactions.
- *
- * @return array
- */
- protected function connectionsToTransact()
- {
- return property_exists($this, 'connectionsToTransact')
- ? $this->connectionsToTransact : [null];
- }
-}
\ No newline at end of file |