<commit_before><?php

namespace MadWeb\Seoable\Test;

class SeoableTwitterCardTest extends TestCase
{
    protected $seoTwitterCard;

    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        parent::setUp();

        $this->seoTwitterCard = $this->app->make('seotools.twitter');
    }

    /** @test */
    public function filling_meta_tags()
    {
        $this->setUpModel();

        $title = $this->app['translator']->trans(
            'seo.'.\MadWeb\Seoable\Test\Models\Post::class.'.twitter_card.title',
            ['title' => $this->testPost->title]
        );

        $description = $this->app['translator']->trans(
            'seo.'.\MadWeb\Seoable\Test\Models\Post::class.'.twitter_card.description',
            ['description' => $this->testPost->description]
        );

        $fullHeader = '';
        $fullHeader .= "<meta name=\"twitter:title\" content=\"$title\">";
        $fullHeader .= "<meta name=\"twitter:description\" content=\"$description\">";
        $fullHeader .= "<meta name=\"twitter:url\" content=\"{$this->testPost->url}\">";
        $fullHeader .= "<meta name=\"twitter:site\" content=\"{$this->testPost->site}\">";
        $fullHeader .= "<meta name=\"twitter:card\" content=\"{$this->testPost->type}\">";
        $fullHeader .= "<meta name=\"twitter:foo0\" content=\"{$this->testPost->title}\">";
        $fullHeader .= "<meta name=\"twitter:foo1\" content=\"{$this->testPost->slug}\">";
        $fullHeader .= "<meta name=\"twitter:name\" content=\"{$this->testPost->title}\">";
        $fullHeader .= "<meta name=\"twitter:some\" content=\"{$this->testPost->slug}\">";
        $fullHeader .= "<meta name=\"twitter:images0\" content=\"{$this->testPost->image}\">";
        $fullHeader .= "<meta name=\"twitter:images1\" content=\"{$this->testPost->image}\">";

        $this->setRightAssertion($fullHeader);
    }

    protected function generatedTags()
    {
        return $this->seoTwitterCard->generate(true);
    }

    protected function setUpModel()
    {
        $this->testPost->seoable()
        ->twitter()
            ->setTitle('title')
            ->setDescription('description')
            ->setUrl('url')
            ->setSite('site')<commit_msg>Fixed twitter card test<commit_after><?php

namespace MadWeb\Seoable\Test;

class SeoableTwitterCardTest extends TestCase
{
    protected $seoTwitterCard;

    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        parent::setUp();

        $this->seoTwitterCard = $this->app->make('seotools.twitter');
    }

    /** @test */
    public function filling_meta_tags()
    {
        $this->setUpModel();

        $title = $this->app['translator']->trans(
            'seo.'.\MadWeb\Seoable\Test\Models\Post::class.'.twitter_card.title',
            ['title' => $this->testPost->title]
        );

        $description = $this->app['translator']->trans(
            'seo.'.\MadWeb\Seoable\Test\Models\Post::class.'.twitter_card.description',
            ['description' => $this->testPost->description]
        );

        $fullHeader = '';
        $fullHeader .= "<meta name=\"twitter:title\" content=\"$title\">";
        $fullHeader .= "<meta name=\"twitter:description\" content=\"$description\">";
        $fullHeader .= "<meta name=\"twitter:url\" content=\"{$this->testPost->url}\">";
        $fullHeader .= "<meta name=\"twitter:site\" content=\"{$this->testPost->site}\">";
        $fullHeader .= "<meta name=\"twitter:card\" content=\"{$this->testPost->type}\">";
        $fullHeader .= "<meta name=\"twitter:image0\" content=\"{$this->testPost->image}\">";
        $fullHeader .= "<meta name=\"twitter:image1\" content=\"{$this->testPost->image}\">";
        $fullHeader .= "<meta name=\"twitter:foo0\" content=\"{$this->testPost->title}\">";
        $fullHeader .= "<meta name=\"twitter:foo1\" content=\"{$this->testPost->slug}\">";
        $fullHeader .= "<meta name=\"twitter:name\" content=\"{$this->testPost->title}\">";
        $fullHeader .= "<meta name=\"twitter:some\" content=\"{$this->testPost->slug}\">";

        $this->setRightAssertion($fullHeader);
    }

    protected function generatedTags()
    {
        return $this->seoTwitterCard->generate(true);
    }

    protected function setUpModel()
    {
        $this->testPost->seoable()
        ->twitter()
            ->setTitle('title')
            ->setDescription('description')
            ->setUrl('url')
            ->setSite('site')
{'fraction_non_alphanumeric': 0.2151501568803227, 'fraction_numerical': 0.0017929179740026895, 'mean_word_length': 2.6945364238410594, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 109, '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': '3724487', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1295, 'n_words': 184}