<commit_before><?php

namespace App\Tests;

use Cache;
use TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class NotesTest extends TestCase
{
    protected $appurl;
    protected $notesController;

    public function setUp()
    {
        parent::setUp();
        $this->appurl = config('app.url');
        $this->notesController = new \App\Http\Controllers\NotesController();
    }

    /**
     * Test the `/notes` page returns 200, this should
     * mean the database is being hit.
     *
     * @return void
     */
    public function testNotesPage()
    {
        $this->visit($this->appurl . '/notes')
             ->assertResponseOk();
    }

    /**
     * Test a specific note so that `singleNote()` get called.
     *
     * @return void
     */
    public function testSpecificNote()
    {
        $this->visit($this->appurl . '/notes/B')
             ->see('#beer');
    }

    /**
     * Test that `/note/{decID}` redirects to `/notes/{nb60id}`.
     *
     * @return void
     */
    public function testDecIDRedirect()
    {
        $this->get($this->appurl . '/note/11')
             ->assertRedirectedTo(config('app.url') . '/notes/B');
    }

    /**
     * Visit the tagged page and see text from the note.
     *
     * @return void
     */
    public function testTaggedNotesPage()
    {
        $this->visit($this->appurl . '/notes/tagged/beer')
             ->see('at the local.');
    }

    /**
     * Look for a default image in the contact’s h-card.
     *
     * @return void
     */
    public function testDefaultImageUsed()
    {
        $this->visit($this->appurl . '/notes/C')
             ->see('<img class="u-photo photo logo" alt="" src="/assets/profile-images/default-image">');
    }

    /**
     * Look for a specific profile image in the contact’s h-card.
     *
     * @return void
     */
    public function testProfileImageUsed()
    {
        $this->visit($this->appurl . '/notes/D')
             ->see('<img class="u-photo photo logo" alt="" src="/assets/profile-images/aaronparecki.com/image">');
    }

    /**
     * Look for twitter URL when there’s no associated contact.
     *
     * @return void
     */
    public function testTwitterLinkCreatedWhenNoContactFound()
    {
        $this->visit($this->appurl . '/notes/E')
             ->see('<a href="https://twitter.com/bob">@bob</a>');
    }

    /**
     * Test hashtag linking.
     *
     * @return void
     */
    public function testHashtags()
    {
        $this->visit($this->appurl . '/notes/B')
             ->see('<a rel="tag" class="p-category" href="/notes/tagged/beer">#beer</a>');
    }

    /**
     * Look for the client name after the note.
     *
     * @return void
     */
    public function testClientNameDisplayed()<commit_msg>Update tests to match new markup<commit_after><?php

namespace App\Tests;

use Cache;
use TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class NotesTest extends TestCase
{
    protected $appurl;
    protected $notesController;

    public function setUp()
    {
        parent::setUp();
        $this->appurl = config('app.url');
        $this->notesController = new \App\Http\Controllers\NotesController();
    }

    /**
     * Test the `/notes` page returns 200, this should
     * mean the database is being hit.
     *
     * @return void
     */
    public function testNotesPage()
    {
        $this->visit($this->appurl . '/notes')
             ->assertResponseOk();
    }

    /**
     * Test a specific note so that `singleNote()` get called.
     *
     * @return void
     */
    public function testSpecificNote()
    {
        $this->visit($this->appurl . '/notes/B')
             ->see('#beer');
    }

    /**
     * Test that `/note/{decID}` redirects to `/notes/{nb60id}`.
     *
     * @return void
     */
    public function testDecIDRedirect()
    {
        $this->get($this->appurl . '/note/11')
             ->assertRedirectedTo(config('app.url') . '/notes/B');
    }

    /**
     * Visit the tagged page and see text from the note.
     *
     * @return void
     */
    public function testTaggedNotesPage()
    {
        $this->visit($this->appurl . '/notes/tagged/beer')
             ->see('at the local.');
    }

    /**
     * Look for a default image in the contact’s h-card.
     *
     * @return void
     */
    public function testDefaultImageUsed()
    {
        $this->visit($this->appurl . '/notes/C')
             ->see('<img class="u-photo" alt="" src="/assets/profile-images/default-image">');
    }

    /**
     * Look for a specific profile image in the contact’s h-card.
     *
     * @return void
     */
    public function testProfileImageUsed()
    {
        $this->visit($this->appurl . '/notes/D')
             ->see('<img class="u-photo" alt="" src="/assets/profile-images/aaronparecki.com/image">');
    }

    /**
     * Look for twitter URL when there’s no associated contact.
     *
     * @return void
     */
    public function testTwitterLinkCreatedWhenNoContactFound()
    {
        $this->visit($this->appurl . '/notes/E')
             ->see('<a href="https://twitter.com/bob">@bob</a>');
    }

    /**
     * Test hashtag linking.
     *
     * @return void
     */
    public function testHashtags()
    {
        $this->visit($this->appurl . '/notes/B')
             ->see('<a rel="tag" class="p-category" href="/notes/tagged/beer">#beer</a>');
    }

    /**
     * Look for the client name after the note.
     *
     * @return void
     */
    public function testClientNameDisplayed()
{'fraction_non_alphanumeric': 0.15317969156125455, 'fraction_numerical': 0.002425922717033443, 'mean_word_length': 2.060445387062566, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 67, 'https://': 2, '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': '2599563', 'n_tokens_mistral': 1773, 'n_tokens_neox': 1735, 'n_words': 388}