<commit_before><?php

declare(strict_types=1);

namespace Enqueue\Tests;

use Doctrine\Persistence\ManagerRegistry;
use Enqueue\ConnectionFactoryFactoryInterface;
use Enqueue\Dbal\ManagerRegistryConnectionFactory;
use Enqueue\Doctrine\DoctrineConnectionFactoryFactory;
use PHPUnit\Framework\TestCase;

class DoctrineConnectionFactoryFactoryTest extends TestCase
{
    /**
     * @var ManagerRegistry|\Prophecy\Prophecy\ObjectProphecy
     */
    private $registry;
    /**
     * @var ConnectionFactoryFactoryInterface|\Prophecy\Prophecy\ObjectProphecy
     */
    private $fallbackFactory;
    /**
     * @var DoctrineConnectionFactoryFactory
     */
    private $factory;

    protected function setUp(): void
    {
        $this->registry = $this->prophesize(ManagerRegistry::class);
        $this->fallbackFactory = $this->prophesize(ConnectionFactoryFactoryInterface::class);

        $this->factory = new DoctrineConnectionFactoryFactory($this->registry->reveal(), $this->fallbackFactory->reveal());
    }

    public function testCreateWithoutArray()
    {
        $this->expectException(\InvalidArgumentException::class);
        $this->expectExceptionMessage('The config must be either array or DSN string.');<commit_msg>Fix prophecy warning<commit_after><?php

declare(strict_types=1);

namespace Enqueue\Tests;

use Doctrine\Persistence\ManagerRegistry;
use Enqueue\ConnectionFactoryFactoryInterface;
use Enqueue\Dbal\ManagerRegistryConnectionFactory;
use Enqueue\Doctrine\DoctrineConnectionFactoryFactory;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class DoctrineConnectionFactoryFactoryTest extends TestCase
{
    use ProphecyTrait;

    /**
     * @var ManagerRegistry|\Prophecy\Prophecy\ObjectProphecy
     */
    private $registry;
    /**
     * @var ConnectionFactoryFactoryInterface|\Prophecy\Prophecy\ObjectProphecy
     */
    private $fallbackFactory;
    /**
     * @var DoctrineConnectionFactoryFactory
     */
    private $factory;

    protected function setUp(): void
    {
        $this->registry = $this->prophesize(ManagerRegistry::class);
        $this->fallbackFactory = $this->prophesize(ConnectionFactoryFactoryInterface::class);

        $this->factory = new DoctrineConnectionFactoryFactory($this->registry->reveal(), $this->fallbackFactory->reveal());
    }

    public function testCreateWithoutArray()
    {
        $this->expectException(\InvalidArgumentException::class);
        $this->expectExceptionMessage('The config must be either array or DSN string.');
{'fraction_non_alphanumeric': 0.10684606252473289, 'fraction_numerical': 0.0007914523149980214, 'mean_word_length': 4.424892703862661, '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': '125410', 'n_tokens_mistral': 687, 'n_tokens_neox': 673, 'n_words': 115}