<commit_before><?php
namespace Tests\Unit;

use App\Models\Depreciation;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Tests\Unit\BaseTest;
use App\Models\Category;
use Carbon;
use App\Models\License;

class DepreciationTest extends BaseTest
{
    /**
     * @var \UnitTester
     */
    protected $tester;



    public function testADepreciationHasModels()
    {
        $this->createValidAssetModel();
        $depreciation = $this->createValidDepreciation('computer', ['name' => 'New Depreciation']);
        $models = \App\Models\AssetModel::factory()->count(5)->mbp13Model()->create(['depreciation_id'=>$depreciation->id]);
        $this->assertEquals(5, $depreciation->models->count());
    }

    public function testADepreciationHasLicenses()
    {

        $depreciation = Depreciation::factory()->create();
        License::factory()
                    ->count(5)
                    ->photoshop()
                    ->create(
                        [
                            'category_id' => Category::factory()->licenseGraphicsCategory(),
                            'depreciation_id' => $depreciation->id               
                        ]);

        $this->assertEquals(5, $depreciation->licenses()->count());
    }
}
<commit_msg>Slight refactor on depreciation test<commit_after><?php
namespace Tests\Unit;

use App\Models\Depreciation;
use Tests\Unit\BaseTest;
use App\Models\Category;
use App\Models\License;
use App\Models\AssetModel;

class DepreciationTest extends BaseTest
{
    /**
     * @var \UnitTester
     */
    protected $tester;



    public function testADepreciationHasModels()
    {
        $this->createValidAssetModel();
        $depreciation = Depreciation::factory()->create();

        AssetModel::factory()
                    ->mbp13Model()
                    ->count(5)
                    ->create(
                        [
                            'category_id' => Category::factory()->assetLaptopCategory(),
                            'depreciation_id' => $depreciation->id               
                        ]);


        $this->assertEquals(5, $depreciation->models->count());
    }

    public function testADepreciationHasLicenses()
    {

        $depreciation = Depreciation::factory()->create();
        License::factory()
                    ->count(5)
                    ->photoshop()
                    ->create(
                        [
                            'category_id' => Category::factory()->licenseGraphicsCategory(),
                            'depreciation_id' => $depreciation->id               
                        ]);

        $this->assertEquals(5, $depreciation->licenses()->count());
    }
}

{'fraction_non_alphanumeric': 0.12974122651542006, 'fraction_numerical': 0.004253810705423609, 'mean_word_length': 1.8943589743589744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 48, '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': '5754471', 'n_tokens_mistral': 773, 'n_tokens_neox': 718, 'n_words': 111}