<commit_before><?php

namespace Tests\DependencyInjection;

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
use Zenstruck\CacheBundle\DependencyInjection\ZenstruckCacheExtension;

/**
 * @author <NAME> <<EMAIL>>
 */
class ZenstruckCacheExtensionTest extends AbstractExtensionTestCase
{
    public function testDefault()
    {
        $this->load();
        $this->compile();

        $this->assertTrue($this->container->has('zenstruck_cache.crawler'));
        $this->assertTrue($this->container->has('zenstruck_cache.http_cache_warmup_command'));
        $this->assertFalse($this->container->has('zenstruck_cache.sitemap_provider'));
    }

    public function testWithHost()
    {
        $this->load(
            array(
                'sitemap_provider' => array(
                    'host' => 'http://www.example.com',
                ),
            )
        );
        $this->compile();

        $this->assertTrue($this->container->has('zenstruck_cache.crawler'));
        $this->assertTrue($this->container->has('zenstruck_cache.http_cache_warmup_command'));
        $this->assertTrue($this->container->has('zenstruck_cache.sitemap_provider'));
    }

    /**
     * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
     */
    public function testMissingHost()
    {
        $this->load(
            array(
                'sitemap_provider' => array(
                    'host' => null,
                ),
            )
        );
        $this->compile();
    }

    /**
     * {@inheritdoc}
     */
    protected function getContainerExtensions()
    {
        return array(new ZenstruckCacheExtension());
    }
}<commit_msg>added hosts test, removed missing config test<commit_after><?php

namespace Tests\DependencyInjection;

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
use Zenstruck\CacheBundle\DependencyInjection\ZenstruckCacheExtension;

/**
 * @author <NAME> <<EMAIL>>
 */
class ZenstruckCacheExtensionTest extends AbstractExtensionTestCase
{
    public function testDefault()
    {
        $this->load();
        $this->compile();

        $this->assertTrue($this->container->has('zenstruck_cache.crawler'));
        $this->assertTrue($this->container->has('zenstruck_cache.http_cache_warmup_command'));
        $this->assertFalse($this->container->has('zenstruck_cache.sitemap_provider'));
    }

    public function testWithHost()
    {
        $this->load(
            array(
                'sitemap_provider' => array(
                    'host' => 'http://www.example.com',
                ),
            )
        );
        $this->compile();

        $this->assertTrue($this->container->has('zenstruck_cache.crawler'));
        $this->assertTrue($this->container->has('zenstruck_cache.http_cache_warmup_command'));
        $this->assertTrue($this->container->has('zenstruck_cache.sitemap_provider'));
    }

    public function testWithHosts()
    {
        $this->load(
            array(
                'sitemap_provider' => array(
                    'hosts' => ['http://www.example.com'],
                ),
            )
        );
        $this->compile();

        $this->assertTrue($this->container->has('zenstruck_cache.crawler'));
        $this->assertTrue($this->container->has('zenstruck_cache.http_cache_warmup_command'));
        $this->assertTrue($this->container->has('zenstruck_cache.sitemap_provider'));
    }

    /**
     * {@inheritdoc}
     */
    protected function getContainerExtensions()
    {
        return array(new ZenstruckCacheExtension());
    }
}
{'fraction_non_alphanumeric': 0.14490753519182997, 'fraction_numerical': 0.0, 'mean_word_length': 2.588118811881188, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 74, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, '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': '3432406', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1008, 'n_words': 115}