<commit_before><?php

namespace Doctrine\Tests\DBAL\Functional;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\ConnectionException;
use Doctrine\DBAL\Driver\Connection as DriverConnection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalFunctionalTestCase;
use Error;
use Exception;
use PDO;
use RuntimeException;
use Throwable;
use function in_array;

class ConnectionTest extends DbalFunctionalTestCase
{
    protected function setUp() : void
    {
        $this->resetSharedConn();
        parent::setUp();
    }

    protected function tearDown() : void
    {
        parent::tearDown();
        $this->resetSharedConn();
    }

    public function testGetWrappedConnection() : void
    {
        self::assertInstanceOf(DriverConnection::class, $this->connection->getWrappedConnection());
    }

    public function testCommitWithRollbackOnlyThrowsException() : void
    {
        $this->connection->beginTransaction();
        $this->connection->setRollbackOnly();

        $this->expectException(ConnectionException::class);
        $this->connection->commit();
    }

    public function testTransactionNestingBehavior() : void<commit_msg>Remove temporary DB file on teardown<commit_after><?php

namespace Doctrine\Tests\DBAL\Functional;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\ConnectionException;
use Doctrine\DBAL\Driver\Connection as DriverConnection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalFunctionalTestCase;
use Error;
use Exception;
use PDO;
use RuntimeException;
use Throwable;
use function file_exists;
use function in_array;
use function unlink;

class ConnectionTest extends DbalFunctionalTestCase
{
    protected function setUp() : void
    {
        $this->resetSharedConn();
        parent::setUp();
    }

    protected function tearDown() : void
    {
        if (file_exists('/tmp/test_nesting.sqlite')) {
            unlink('/tmp/test_nesting.sqlite');
        }

        parent::tearDown();
        $this->resetSharedConn();
    }

    public function testGetWrappedConnection() : void
    {
        self::assertInstanceOf(DriverConnection::class, $this->connection->getWrappedConnection());
    }

    public function testCommitWithRollbackOnlyThrowsException() : void
    {
        $this->connection->beginTransaction();
        $this->connection->setRollbackOnly();

        $this->expectException(ConnectionException::class);
        $this->connection->commit();
    }

    public function testTransactionNestingBehavior() : void
{'fraction_non_alphanumeric': 0.10714285714285714, 'fraction_numerical': 0.0, 'mean_word_length': 3.994485294117647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1083617', 'n_tokens_mistral': 765, 'n_tokens_neox': 753, 'n_words': 149}