From d6c61e1429d8a9cb4a6a79f19b042f614ab534a3 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 25 Jan 2024 21:34:20 +0000 Subject: [PATCH] Removed attribute assigning blank EOL as 0 Signed-off-by: snipe --- app/Models/AssetModel.php | 9 --------- tests/Unit/AssetModelTest.php | 11 +---------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/app/Models/AssetModel.php b/app/Models/AssetModel.php index d0e47e1cf1..c5fb9284aa 100755 --- a/app/Models/AssetModel.php +++ b/app/Models/AssetModel.php @@ -46,15 +46,6 @@ class AssetModel extends SnipeModel protected $injectUniqueIdentifier = true; use ValidatingTrait; - public function setEolAttribute($value) - { - if ($value == '') { - $value = 0; - } - - $this->attributes['eol'] = $value; - } - /** * The attributes that are mass assignable. * diff --git a/tests/Unit/AssetModelTest.php b/tests/Unit/AssetModelTest.php index 845e7fce90..aec8edf692 100644 --- a/tests/Unit/AssetModelTest.php +++ b/tests/Unit/AssetModelTest.php @@ -10,16 +10,7 @@ use Tests\TestCase; class AssetModelTest extends TestCase { use InteractsWithSettings; - - public function testAnAssetModelZerosOutBlankEols() - { - $am = new AssetModel; - $am->eol = ''; - $this->assertTrue($am->eol === 0); - $am->eol = '4'; - $this->assertTrue($am->eol == 4); - } - + public function testAnAssetModelContainsAssets() { $category = Category::factory()->create([