<commit_before><?php

namespace Tests\Unit;

use Tests\TestCase;
use App\SloaAccountingLine;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class SloaAccountingLineTest extends TestCase
{
    use RefreshDatabase;

    /** @test */
    public function it_adds_a_guid_to_each_fund_as_the_id()
    {
        $sloaAccountingLine = factory(SloaAccountingLine::class)->create();
        $this->assertNotNull($sloaAccountingLine->uuid);
        $this->assertEquals(36, strlen($sloaAccountingLine->uuid));
    }

    /** @test */
    public function it_can_identify_its_supporting_fund()
    {
        $sloaAccountingLine = factory(SloaAccountingLine::class)->create();
        $this->assertNotNull($sloaAccountingLine->funds);
        $this->assertCount(1, $sloaAccountingLine->funds);
        $this->assertEquals(36, strlen($sloaAccountingLine->funds->first()->uuid));
    }

    /** @test */
    public function it_tracks_the_sub_class_and_allows_it_to_be_null()
    {
        // Tracking
        $sloaAccountingLine = factory(SloaAccountingLine::class)->create(['sub_class' => '46']);
        $this->assertNotNull($sloaAccountingLine->sub_class);<commit_msg>Added polymorphic model validation of UUIDs in automated test cases.<commit_after><?php

namespace Tests\Unit;

use Tests\TestCase;
use App\SloaAccountingLine;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class SloaAccountingLineTest extends TestCase
{
    use RefreshDatabase;

    /** @test */
    public function it_adds_a_guid_to_each_fund_as_the_id()
    {
        $sloaAccountingLine = factory(SloaAccountingLine::class)->create();
        $this->assertNotNull($sloaAccountingLine->uuid);
        $this->assertEquals(36, strlen($sloaAccountingLine->uuid));
    }

    /** @test */
    public function it_can_identify_its_supporting_fund()
    {
        $sloaAccountingLine = factory(SloaAccountingLine::class)->create();
        $this->assertNotNull($sloaAccountingLine->funds);
        $this->assertCount(1, $sloaAccountingLine->funds);
        $this->assertEquals($sloaAccountingLine->uuid, $sloaAccountingLine->funds->first()->accountable_id);
    }

    /** @test */
    public function it_tracks_the_sub_class_and_allows_it_to_be_null()
    {
        // Tracking
        $sloaAccountingLine = factory(SloaAccountingLine::class)->create(['sub_class' => '46']);
        $this->assertNotNull($sloaAccountingLine->sub_class);
{'fraction_non_alphanumeric': 0.12942122186495178, 'fraction_numerical': 0.00482315112540193, 'mean_word_length': 4.273305084745763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '3816266', 'n_tokens_mistral': 805, 'n_tokens_neox': 777, 'n_words': 100}