<commit_before><?php

namespace Flyers\FrontendBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

/**
 * Class DefaultControllerTest
 * @package Flyers\FrontendBundle\Tests\Controller
 */
class DefaultControllerTest extends WebTestCase
{
    /**
     * Test if ng-app directive exists and is sammui
     */
    public function testAngularSammui()
    {
        $client = static::createClient();

        $crawler = $client->request('GET', '/');

        $this->assertEquals('sammui', $crawler->filterXPath('//html')->attr('ng-app'));
    }
}<commit_msg>OAuth client meta tag tests<commit_after><?php

namespace Flyers\FrontendBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DomCrawler\Crawler;

/**
 * Class DefaultControllerTest
 * @package Flyers\FrontendBundle\Tests\Controller
 */
class DefaultControllerTest extends WebTestCase
{
    /**
     * Test if ng-app directive exists and is sammui
     * @return \Symfony\Component\DomCrawler\Crawler
     */
    public function testAngularSammui()
    {
        $client = static::createClient();

        $crawler = $client->request('GET', '/');

        $this->assertEquals('sammui', $crawler->filterXPath('//html')->attr('ng-app'));

        return $crawler;
    }

    /**
     * @depends testAngularSammui
     * @param Crawler $crawler
     */
    public function testSammuiClient(Crawler $crawler)
    {
        $clientId = $crawler->filterXPath('//html/head/meta[@name="sammui-oauth2-client-id"]')->attr('content');
        $clientSecret = $crawler->filterXPath('//html/head/meta[@name="sammui-oauth2-client-secret"]')->attr('content');

        $this->assertNotNull($clientId);
        $this->assertNotNull($clientSecret);
        $this->assertTrue((is_string($clientId)), $clientId);
        $this->assertTrue((is_string($clientSecret)), $clientSecret);
    }
}
{'fraction_non_alphanumeric': 0.15412940557601262, 'fraction_numerical': 0.0010520778537611783, 'mean_word_length': 3.6053268765133173, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '4940785', 'n_tokens_mistral': 589, 'n_tokens_neox': 582, 'n_words': 89}