<commit_before><?php

/*
 * This file is part of the OverblogDataLoaderBundle package.
 *
 * (c) Overblog <http://github.com/overblog/>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Overblog\DataLoaderBundle\Tests\DependencyInjection;

use Overblog\DataLoaderBundle\DependencyInjection\Configuration;
use Overblog\DataLoaderBundle\DependencyInjection\OverblogDataLoaderExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

class OverblogDataLoaderExtensionTest extends TestCase
{
    /**
     * @var ContainerBuilder
     */
    private $container;
    /**
     * @var OverblogDataLoaderExtension
     */
    private $extension;

    public function setUp()
    {
        $this->container = new ContainerBuilder();
        $this->container->setParameter('kernel.bundles', []);
        $this->container->setParameter('kernel.debug', false);
        $this->extension = new OverblogDataLoaderExtension();
    }

    public function tearDown()
    {
        unset($this->container, $this->extension);
    }

    public function testValidServiceCallableNodeValue()
    {
        $validValues = ['@app.user:getUsers', '@App\\Loader\\User:all'];
        foreach ($validValues as $validValue) {
            $this->assertRegExp(Configuration::SERVICE_CALLABLE_NOTATION_REGEX, $validValue);
        }
    }

    public function testValidPhpCallableNodeValue() {
        $validValues = ['Image\\Loader::get', 'Post::getPosts'];
        foreach ($validValues as $validValue) {
            $this->assertRegExp(Configuration::PHP_CALLABLE_NOTATION_REGEX, $validValue);
        }
    }

    public function testUsersDataLoaderConfig()
    {
        $this->loadValidConfig();

        $serviceDataLoaderID = 'overblog_dataloader.users_loader';<commit_msg>- Fixed phpcsfixer<commit_after><?php

/*
 * This file is part of the OverblogDataLoaderBundle package.
 *
 * (c) Overblog <http://github.com/overblog/>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Overblog\DataLoaderBundle\Tests\DependencyInjection;

use Overblog\DataLoaderBundle\DependencyInjection\Configuration;
use Overblog\DataLoaderBundle\DependencyInjection\OverblogDataLoaderExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

class OverblogDataLoaderExtensionTest extends TestCase
{
    /**
     * @var ContainerBuilder
     */
    private $container;
    /**
     * @var OverblogDataLoaderExtension
     */
    private $extension;

    public function setUp()
    {
        $this->container = new ContainerBuilder();
        $this->container->setParameter('kernel.bundles', []);
        $this->container->setParameter('kernel.debug', false);
        $this->extension = new OverblogDataLoaderExtension();
    }

    public function tearDown()
    {
        unset($this->container, $this->extension);
    }

    public function testValidServiceCallableNodeValue()
    {
        $validValues = ['@app.user:getUsers', '@App\\Loader\\User:all'];
        foreach ($validValues as $validValue) {
            $this->assertRegExp(Configuration::SERVICE_CALLABLE_NOTATION_REGEX, $validValue);
        }
    }

    public function testValidPhpCallableNodeValue()
    {
        $validValues = ['Image\\Loader::get', 'Post::getPosts'];
        foreach ($validValues as $validValue) {
            $this->assertRegExp(Configuration::PHP_CALLABLE_NOTATION_REGEX, $validValue);
        }
    }

    public function testUsersDataLoaderConfig()
    {
        $this->loadValidConfig();

        $serviceDataLoaderID = 'overblog_dataloader.users_loader';
{'fraction_non_alphanumeric': 0.11155678114815744, 'fraction_numerical': 0.0, 'mean_word_length': 3.661214953271028, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, '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': '6985869', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1073, 'n_words': 209}