ConfigurationTest.php 1.14 KB
Newer Older
1 2
<?php

3
namespace Doctrine\DBAL\Tests;
4 5

use Doctrine\DBAL\Configuration;
6
use PHPUnit\Framework\TestCase;
7 8 9 10

/**
 * Unit tests for the configuration container.
 */
11
class ConfigurationTest extends TestCase
12 13 14 15
{
    /**
     * The configuration container instance under test.
     *
Sergei Morozov's avatar
Sergei Morozov committed
16
     * @var Configuration
17 18 19
     */
    protected $config;

20
    protected function setUp(): void
21 22 23 24 25 26 27 28 29
    {
        $this->config = new Configuration();
    }

    /**
     * Tests that the default auto-commit mode for connections can be retrieved from the configuration container.
     *
     * @group DBAL-81
     */
30
    public function testReturnsDefaultConnectionAutoCommitMode(): void
31
    {
32
        self::assertTrue($this->config->getAutoCommit());
33 34 35 36 37 38 39
    }

    /**
     * Tests that the default auto-commit mode for connections can be set in the configuration container.
     *
     * @group DBAL-81
     */
40
    public function testSetsDefaultConnectionAutoCommitMode(): void
41 42 43
    {
        $this->config->setAutoCommit(false);

44
        self::assertFalse($this->config->getAutoCommit());
45 46 47

        $this->config->setAutoCommit(0);

48
        self::assertFalse($this->config->getAutoCommit());
49 50
    }
}