Browse Source

Add test for primary key back in.

Lacey Sanderson 6 years ago
parent
commit
f80848f42d
1 changed files with 6 additions and 16 deletions
  1. 6 16
      tests/tripal_chado/api/ChadoSchemaTest.php

+ 6 - 16
tests/tripal_chado/api/ChadoSchemaTest.php

@@ -143,22 +143,12 @@ class ChadoSchemaTest extends TripalTestCase {
     // Instead of asserting these keys exist. Lets assert that if they do exist,
     // they match the expected format.
 
-/*
-    $this->assertArrayHasKey(
-      'primary key',
-      $table_schema,
-      t('The schema array for "!table" should have the primary key listed in an "primary key" array',
-        array('!table' => $table_name))
-    );
-*/
-/*
-    $this->assertArrayHasKey(
-      'unique keys',
-      $table_schema,
-      t('The schema array for "!table" should have unique keys listed in an "unique keys" array',
-        array('!table' => $table_name))
-    );
-*/
+    if (isset($table_schema['primary key'])) {
+      $this->assertTrue(is_array($table_schema['primary key']),
+	t('The primary key of the Tripal Schema definition for "!table" must be an array.',
+          array('!table' => $table_name)));
+  
+    }
 
     $this->assertArrayHasKey(
       'foreign keys',