ConfigurationTest.php 1.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php

namespace Doctrine\Tests\DBAL;

use Doctrine\DBAL\Configuration;
use Doctrine\Tests\DbalTestCase;

/**
 * Unit tests for the configuration container.
 */
class ConfigurationTest extends DbalTestCase
{
    /**
     * 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
    }
}