Completed
Pull Request — master (#3808)
by Sergei
60:47
created

ExecutionModeTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
dl 0
loc 22
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testDefaultAutoCommitStatus() 0 3 1
A testChangeAutoCommitStatus() 0 7 1
A setUp() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\DBAL\Driver\OCI8;
6
7
use Doctrine\DBAL\Driver\OCI8\ExecutionMode;
8
use PHPStan\Testing\TestCase;
9
10
final class ExecutionModeTest extends TestCase
11
{
12
    /** @var ExecutionMode */
13
    private $mode;
14
15
    protected function setUp() : void
16
    {
17
        $this->mode = new ExecutionMode();
18
    }
19
20
    public function testDefaultAutoCommitStatus() : void
21
    {
22
        self::assertTrue($this->mode->isAutoCommitEnabled());
23
    }
24
25
    public function testChangeAutoCommitStatus() : void
26
    {
27
        $this->mode->disableAutoCommit();
28
        self::assertFalse($this->mode->isAutoCommitEnabled());
29
30
        $this->mode->enableAutoCommit();
31
        self::assertTrue($this->mode->isAutoCommitEnabled());
32
    }
33
}
34