Some simple renames for better readability as suggested by Marcus

This commit is contained in:
Brady Wetherington 2024-04-16 15:17:02 +01:00
parent 67a8e0b5c6
commit 266424ff0e
3 changed files with 4 additions and 4 deletions

View file

@ -353,9 +353,9 @@ class AssetFactory extends Factory
return $this->state(['requestable' => false]); return $this->state(['requestable' => false]);
} }
public function has_encrypted_custom_field() public function hasEncryptedCustomField()
{ {
return $this->state(['model_id' => AssetModel::where('name', 'asset with encrypted field')->first() ?? AssetModel::factory()->encrypted_field()]); return $this->state(['model_id' => AssetModel::where('name', 'asset with encrypted field')->first() ?? AssetModel::factory()->withEncryptedField()]);
} }

View file

@ -431,7 +431,7 @@ class AssetModelFactory extends Factory
}); });
} }
public function encrypted_field() public function withEncryptedField()
{ {
return $this->state(function () { return $this->state(function () {
$field = CustomField::factory()->testEncrypted()->create(); // TODO - having to create and then 'find' the thing you just created is WEIRD $field = CustomField::factory()->testEncrypted()->create(); // TODO - having to create and then 'find' the thing you just created is WEIRD

View file

@ -485,7 +485,7 @@ class AssetStoreTest extends TestCase
public function testEncryptedCustomField() public function testEncryptedCustomField()
{ {
$field = CustomField::factory()->testEncrypted()->create(); $field = CustomField::factory()->testEncrypted()->create();
$asset = Asset::factory()->has_encrypted_custom_field()->create(); $asset = Asset::factory()->hasEncryptedCustomField()->create();
$superuser = User::factory()->superuser()->create(); $superuser = User::factory()->superuser()->create();
$normal_user = User::factory()->editAssets()->create(); $normal_user = User::factory()->editAssets()->create();