Skip to content

A free open source IT asset/license management system

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

Brady Wetheringtonab4597588306
diff --git a/tests/Feature/Api/Assets/AssetStoreTest.php b/tests/Feature/Api/Assets/AssetStoreTest.php
index aee110976d..5f143904d5 100644
--- a/tests/Feature/Api/Assets/AssetStoreTest.php
+++ b/tests/Feature/Api/Assets/AssetStoreTest.php
@@ -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();
diff --git a/tests/Feature/Api/Assets/AssetUpdateTest.php b/tests/Feature/Api/Assets/AssetUpdateTest.php
index f416645a8a..80e302aeed 100644
--- a/tests/Feature/Api/Assets/AssetUpdateTest.php
+++ b/tests/Feature/Api/Assets/AssetUpdateTest.php
@@ -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();