Mark custom fields tests as 'incomplete' if the DB is mysql

This commit is contained in:
Brady Wetherington 2024-04-22 13:11:36 +01:00
parent 60a5afd752
commit ab45975883
2 changed files with 19 additions and 0 deletions

View file

@ -482,8 +482,16 @@ class AssetStoreTest extends TestCase
});
}
public function markIncompleteIfMySQL()
{
if (config('database.default') === 'mysql') {
$this->markTestIncomplete('Custom Fields tests do not work on MySQL');
}
}
public function testEncryptedCustomFieldCanBeStored()
{
$this->markIncompleteIfMySQL();
$status = Statuslabel::factory()->create();
$field = CustomField::factory()->testEncrypted()->create();
$superuser = User::factory()->superuser()->create();

View file

@ -10,8 +10,18 @@ use Tests\TestCase;
class AssetUpdateTest extends TestCase
{
// TODO - this 'helper' is duplicated in AssetStoreTest - we should extract it out if we can figure out how
public function markIncompleteIfMySQL()
{
if (config('database.default') === 'mysql') {
$this->markTestIncomplete('Custom Fields tests do not work on MySQL');
}
}
public function testEncryptedCustomFieldCanBeUpdated()
{
$this->markIncompleteIfMySQL();
$field = CustomField::factory()->testEncrypted()->create();
$asset = Asset::factory()->hasEncryptedCustomField($field)->create();
$superuser = User::factory()->superuser()->create();
@ -29,6 +39,7 @@ class AssetUpdateTest extends TestCase
public function testPermissionNeededToUpdateEncryptedField()
{
$this->markIncompleteIfMySQL();
$field = CustomField::factory()->testEncrypted()->create();
$asset = Asset::factory()->hasEncryptedCustomField($field)->create();
$normal_user = User::factory()->editAssets()->create();