Completed
Pull Request — master (#335)
by Simon
04:45
created

DatabaseTestCaseTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A startTransactionBefore() 0 5 1
A rollbackTransactionAfter() 0 5 1
1
<?php
2
3
namespace ShopwarePlugins\Connect\Tests;
4
5
trait DatabaseTestCaseTrait
6
{
7
    /**
8
     * @before
9
     */
10
    protected function startTransactionBefore()
11
    {
12
        $connection = Shopware()->Container()->get('dbal_connection');
13
        $connection->beginTransaction();
14
    }
15
16
    /**
17
     * @after
18
     */
19
    protected function rollbackTransactionAfter()
20
    {
21
        $connection = Shopware()->Container()->get('dbal_connection');
22
        $connection->rollBack();
23
    }
24
}