A free open source IT asset/license management system
Import facade
Marcus Moore9d0ea857fee6
diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.phpindex e18a957e0f..aee110976d 100644--- a/tests/Feature/Api/Assets/AssetStoreTest.php+++ b/tests/Feature/Api/Assets/AssetStoreTest.php@@ -10,6 +10,7 @@ use App\Models\Location;use App\Models\Statuslabel;use App\Models\Supplier;use App\Models\User;+use Illuminate\Support\Facades\Crypt;use Illuminate\Testing\Fluent\AssertableJson;use Tests\TestCase;@@ -500,7 +501,7 @@ class AssetStoreTest extends TestCase->json();$asset = Asset::findOrFail($response['payload']['id']);- $this->assertEquals('This is encrypted field', \Crypt::decrypt($asset->{$field->db_column_name()}));+ $this->assertEquals('This is encrypted field', Crypt::decrypt($asset->{$field->db_column_name()}));}public function testPermissionNeededToStoreEncryptedField()@@ -527,6 +528,6 @@ class AssetStoreTest extends TestCase->json();$asset = Asset::findOrFail($response['payload']['id']);- $this->assertEquals('This is encrypted field', \Crypt::decrypt($asset->{$field->db_column_name()}));+ $this->assertEquals('This is encrypted field', Crypt::decrypt($asset->{$field->db_column_name()}));}}diff --git a/tests/Feature/Api/Assets/AssetUpdateTest.php b/tests/Feature/Api/Assets/AssetUpdateTest.phpindex 7a155e1b7f..f416645a8a 100644--- a/tests/Feature/Api/Assets/AssetUpdateTest.php+++ b/tests/Feature/Api/Assets/AssetUpdateTest.php@@ -5,6 +5,7 @@ namespace Tests\Feature\Api\Assets;use App\Models\Asset;use App\Models\CustomField;use App\Models\User;+use Illuminate\Support\Facades\Crypt;use Tests\TestCase;class AssetUpdateTest extends TestCase@@ -23,7 +24,7 @@ class AssetUpdateTest extends TestCase->assertOk();$asset->refresh();- $this->assertEquals('This is encrypted field', \Crypt::decrypt($asset->{$field->db_column_name()}));+ $this->assertEquals('This is encrypted field', Crypt::decrypt($asset->{$field->db_column_name()}));}public function testPermissionNeededToUpdateEncryptedField()@@ -32,7 +33,7 @@ class AssetUpdateTest extends TestCase$asset = Asset::factory()->hasEncryptedCustomField($field)->create();$normal_user = User::factory()->editAssets()->create();- $asset->{$field->db_column_name()} = \Crypt::encrypt("encrypted value should not change");+ $asset->{$field->db_column_name()} = Crypt::encrypt("encrypted value should not change");$asset->save();// test that a 'normal' user *cannot* change the encrypted custom field@@ -45,6 +46,6 @@ class AssetUpdateTest extends TestCase->assertMessagesAre('Asset updated successfully, but encrypted custom fields were not due to permissions');$asset->refresh();- $this->assertEquals("encrypted value should not change", \Crypt::decrypt($asset->{$field->db_column_name()}));+ $this->assertEquals("encrypted value should not change", Crypt::decrypt($asset->{$field->db_column_name()}));}}