<commit_before><?php

use Barryvanveen\Blogs\Blog;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class BlogTest extends TestCase
{
    use DatabaseTransactions;

    public function testBlogOverview()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'published')->create();

        $this->visit(route('home'))
            ->see(trans('general.homepage-title'))
            ->see($blog->title)
            ->see($blog->summary);

        $this->click($blog->title);

        $this->seePageIs(
            route(
                'blog-item',
                [
                    'id'   => $blog->id,
                    'slug' => $blog->slug,
                ]
            )
        );
    }

    public function testOnlineBlogItem()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'published')->create();

        $this->visit(route('blog-item', ['id' => $blog->id, 'slug' => $blog->slug]))
                ->see($blog->title)
                ->see($blog->text);
    }

    public function test404BecauseOfflineBlogItem()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'unpublished-offline')->create();

        try {
            $this->visit(route('blog-item', ['id' => $blog->id, 'slug' => $blog->slug]))
                 ->see($blog->title)
                 ->see($blog->text);
        } catch (Exception $e) {
            $this->assertEquals(Illuminate\Foundation\Testing\HttpException::class, get_class($e));

            return;
        }

        $this->assertTrue(false, 'You shouldn\'t reach this assertion, an exception should have been thrown on form 
        validation');
    }

    public function test404BecauseFutureBlogItem()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'unpublished-future')->create();

        try {
            $this->visit(route('blog-item', ['id' => $blog->id, 'slug' => $blog->slug]))
                ->see($blog->title)
                ->see($blog->text);
        } catch (Exception $e) {
            $this->assertEquals(Illuminate\Foundation\Testing\HttpException::class, get_class($e));

            return;
        }

        $this->assertTrue(false, 'You shouldn\'t reach this assertion, an exception should have been thrown on form 
        validation');
    }

    public function testBlogRssFeed()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'published')->create();

        $this->visit(route('blog-rss'));

        $this->see('<rss version="2.0"')
            ->see('<title>'.$blog->title.'</title>');
    }<commit_msg>fixed blog rss test<commit_after><?php

use Barryvanveen\Blogs\Blog;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class BlogTest extends TestCase
{
    use DatabaseTransactions;

    public function testBlogOverview()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'published')->create();

        $this->visit(route('home'))
            ->see(trans('general.homepage-title'))
            ->see($blog->title)
            ->see($blog->summary);

        $this->click($blog->title);

        $this->seePageIs(
            route(
                'blog-item',
                [
                    'id'   => $blog->id,
                    'slug' => $blog->slug,
                ]
            )
        );
    }

    public function testOnlineBlogItem()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'published')->create();

        $this->visit(route('blog-item', ['id' => $blog->id, 'slug' => $blog->slug]))
                ->see($blog->title)
                ->see($blog->text);
    }

    public function test404BecauseOfflineBlogItem()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'unpublished-offline')->create();

        try {
            $this->visit(route('blog-item', ['id' => $blog->id, 'slug' => $blog->slug]))
                 ->see($blog->title)
                 ->see($blog->text);
        } catch (Exception $e) {
            $this->assertEquals(Illuminate\Foundation\Testing\HttpException::class, get_class($e));

            return;
        }

        $this->assertTrue(false, 'You shouldn\'t reach this assertion, an exception should have been thrown on form 
        validation');
    }

    public function test404BecauseFutureBlogItem()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'unpublished-future')->create();

        try {
            $this->visit(route('blog-item', ['id' => $blog->id, 'slug' => $blog->slug]))
                ->see($blog->title)
                ->see($blog->text);
        } catch (Exception $e) {
            $this->assertEquals(Illuminate\Foundation\Testing\HttpException::class, get_class($e));

            return;
        }

        $this->assertTrue(false, 'You shouldn\'t reach this assertion, an exception should have been thrown on form 
        validation');
    }

    public function testBlogRssFeed()
    {
        /** @var Blog $blog */
        $blog = factory(Barryvanveen\Blogs\Blog::class, 'published')->create();

        $this->visit(route('blog-rss'));

        $this->see('<title>'.$blog->title.'</title>');
    }
{'fraction_non_alphanumeric': 0.17043768545994065, 'fraction_numerical': 0.0025964391691394658, 'mean_word_length': 1.9961111111111112, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 112, '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': '494739', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1542, 'n_words': 275}