<commit_before><?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Tests\Unit\Services;

use Facile\MongoDbBundle\Services\ClientRegistry;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class ClientRegistryTest extends \PHPUnit_Framework_TestCase
{
    public function test_client_connection_url_generation_singlehost()
    {
        $ed = $this->prophesize(EventDispatcherInterface::class);


        $registry = new ClientRegistry($ed->reveal(), 'prod');

        $testConf = [
            'test_client' => [
                'hosts' => [
                    ['host' => 'host1', 'port' => 8080],
                ],
                'username' => 'foo',
                'password' => '<PASSWORD>',
                'replicaSet' => 'testReplica',
                'ssl' => true,
                'connectTimeoutMS' => 3000,
            ],
        ];

        $registry->addClientsConfigurations($testConf);
        $client = $registry->getClient('test_client');

        $this->assertEquals('mongodb://host1:8080',$client->__debugInfo()['uri']);
    }
    public function test_client_connection_url_generation_multyhost()
    {
        $ed = $this->prophesize(EventDispatcherInterface::class);<commit_msg>fix test<commit_after><?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Tests\Unit\Services;

use Facile\MongoDbBundle\Services\ClientRegistry;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class ClientRegistryTest extends TestCase
{
    public function test_client_connection_url_generation_singlehost()
    {
        $ed = $this->prophesize(EventDispatcherInterface::class);


        $registry = new ClientRegistry($ed->reveal(), 'prod');

        $testConf = [
            'test_client' => [
                'hosts' => [
                    ['host' => 'host1', 'port' => 8080],
                ],
                'username' => 'foo',
                'password' => '<PASSWORD>',
                'replicaSet' => 'testReplica',
                'ssl' => true,
                'connectTimeoutMS' => 3000,
            ],
        ];

        $registry->addClientsConfigurations($testConf);
        $client = $registry->getClient('test_client');

        $this->assertEquals('mongodb://host1:8080',$client->__debugInfo()['uri']);
    }
    public function test_client_connection_url_generation_multyhost()
    {
        $ed = $this->prophesize(EventDispatcherInterface::class);
{'fraction_non_alphanumeric': 0.13765182186234817, 'fraction_numerical': 0.012145748987854251, 'mean_word_length': 2.6072992700729927, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 37, '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': '2755289', 'n_tokens_mistral': 732, 'n_tokens_neox': 671, 'n_words': 98}