<commit_before><?php

namespace Backend\Modules\Analytics\Tests\Action;

use Backend\Core\Tests\BackendWebTestCase;
use Symfony\Bundle\FrameworkBundle\Client;

class IndexTest extends BackendWebTestCase
{
    public function testAuthenticationIsNeeded(Client $client): void
    {
        $this->assertAuthenticationIsNeeded($client, '/private/en/analytics/index');
    }

    public function testRedirectToSettingsActionWhenTheAnalyticsModuleIsNotConfigured(): void
    {
        $client = static::createClient();
        $this->login($client);

        $client->setMaxRedirects(1);
        $client->request('GET', '/private/en/analytics/reset');

        // we should have been redirected to the settings page after the reset
        self::assertContains(
            '/private/en/analytics/settings',
            $client->getHistory()->current()->getUri()
        );
    }
}<commit_msg>Clean up analytics index action test<commit_after><?php

namespace Backend\Modules\Analytics\Tests\Action;

use Backend\Core\Tests\BackendWebTestCase;
use Symfony\Bundle\FrameworkBundle\Client;

class IndexTest extends BackendWebTestCase
{
    public function testAuthenticationIsNeeded(Client $client): void
    {
        $this->assertAuthenticationIsNeeded($client, '/private/en/analytics/index');
    }

    public function testRedirectToSettingsActionWhenTheAnalyticsModuleIsNotConfigured(Client $client): void
    {
        $this->login($client);

        $client->setMaxRedirects(1);
        $client->request('GET', '/private/en/analytics/index');

        // we should have been redirected to the settings page because the module isn't configured
        self::assertContains(
            '/private/en/analytics/settings',
            $client->getHistory()->current()->getUri()
        );
    }
}
{'fraction_non_alphanumeric': 0.11669458403126745, 'fraction_numerical': 0.0011166945840312675, 'mean_word_length': 3.5025125628140703, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2272840', 'n_tokens_mistral': 480, 'n_tokens_neox': 477, 'n_words': 92}