ConfigurationTest.php 1.16 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 20 21 22
     */
    protected $config;

    /**
     * {@inheritdoc}
     */
23
    protected function setUp()
24 25 26 27 28 29 30 31 32 33 34
    {
        $this->config = new Configuration();
    }

    /**
     * Tests that the default auto-commit mode for connections can be retrieved from the configuration container.
     *
     * @group DBAL-81
     */
    public function testReturnsDefaultConnectionAutoCommitMode()
    {
35
        self::assertTrue($this->config->getAutoCommit());
36 37 38 39 40 41 42 43 44 45 46
    }

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

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

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

51
        self::assertFalse($this->config->getAutoCommit());
52 53
    }
}