<commit_before><?php

namespace Kunstmaan\GeneratorBundle\Tests\Generator;

use Kunstmaan\GeneratorBundle\Generator\DefaultSiteGenerator;
use Kunstmaan\GeneratorBundle\Helper\CommandAssistant;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;

class DefaultSiteGeneratorTest extends TestCase
{
    public function testGenerator()
    {
        $filesystem = new Filesystem();
        $path = sys_get_temp_dir() . '/' . uniqid();
        $filesystem->remove($path);

        $bundle = $this->getBundle($path);
        $container = $this->createMock('Symfony\Component\DependencyInjection\Container');
        $container
            ->expects($this->any())
            ->method('getParameter')
            ->will($this->returnValueMap([['multilanguage', true], ['kernel.project_dir', $path]]))
        ;
        $container
            ->expects($this->any())
            ->method('hasParameter')
            ->with('multilanguage')
            ->will($this->returnValue(true))
        ;

        $generator = new DefaultSiteGenerator($filesystem, $this->getRegistry(), '/defaultsite', $this->getAssistant(), $container);
        $generator->generate($bundle, '', __DIR__ . '/../../_data', false);

        $basePath = Kernel::VERSION_ID >= 40000 ? 'templates/bundles/' : 'app/resources/';
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error.html.twig');
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error404.html.twig');
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error500.html.twig');
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error503.html.twig');<commit_msg>[AllBundles] Test latest symfony and supported lts (#2333)<commit_after><?php

namespace Kunstmaan\GeneratorBundle\Tests\Generator;

use Kunstmaan\GeneratorBundle\Generator\DefaultSiteGenerator;
use Kunstmaan\GeneratorBundle\Helper\CommandAssistant;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;

class DefaultSiteGeneratorTest extends TestCase
{
    public function testGenerator()
    {
        $filesystem = new Filesystem();
        $path = sys_get_temp_dir() . '/' . uniqid();
        $filesystem->remove($path);

        $bundle = $this->getBundle($path);
        $container = $this->createMock('Symfony\Component\DependencyInjection\Container');
        $container
            ->expects($this->any())
            ->method('getParameter')
            ->will($this->returnValueMap([['multilanguage', true], ['kernel.project_dir', $path]]))
        ;
        $container
            ->expects($this->any())
            ->method('hasParameter')
            ->with('multilanguage')
            ->will($this->returnValue(true))
        ;

        $generator = new DefaultSiteGenerator($filesystem, $this->getRegistry(), '/defaultsite', $this->getAssistant(), $container);
        $generator->generate($bundle, '', __DIR__ . '/../../_data', false);

        $basePath = Kernel::VERSION_ID >= 40000 ? 'templates/bundles/' : 'app/Resources/';
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error.html.twig');
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error404.html.twig');
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error500.html.twig');
        unlink(__DIR__ . '/../../_data/' . $basePath . 'TwigBundle/views/Exception/error503.html.twig');
{'fraction_non_alphanumeric': 0.17308224868457492, 'fraction_numerical': 0.008861811132650235, 'mean_word_length': 2.995575221238938, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '5556578', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1039, 'n_words': 156}