Browse Source

add colon test

bradford.condon 6 years ago
parent
commit
fcaff0a53b

+ 8 - 1
tests/tripal_chado/example_files/pto_colon.obo

@@ -8,4 +8,11 @@ ontology: to
 
 
 [Term]
-id: CHEBI:132502 ! fatty acid 18:3
+id: CHEBI:132502 ! fatty acid 18:3
+
+
+[Term]
+id: TO:1000066
+name: shoot system nickel content
+def: "A nickel content trait (TO:0006051) which is the nickel cation (CHEBI:25516) composition in a shoot system (PO:0009006)." [https://search.proquest.com/docview/1426182399, TO:cooperl]
+synonym: "shoot Ni content (related)" RELATED []

+ 13 - 3
tests/tripal_chado/loaders/OBOImporterTest.php

@@ -15,21 +15,31 @@ class OBOImporterTest extends TripalTestCase {
      * @group obo
      * @ticket 525
      */
-    public function test_PTO_loads() {
+    public function test_PTO_loads_colon_issue() {
       $this->load_pto_mini();
 
       $exists = db_select('chado.cv', 'c')
         ->fields('c', ['cv_id'])
-        ->condition('name', 'core_test_PTO_mini');
+        ->condition('name', 'core_test_PTO_mini')
+        ->execute()
+        ->fetchField();
       $this->assertNotNull($exists);
 
+      //hte colon splitting issue: a new CV will created named fatty acid 18
+      $exists = db_select('chado.cv', 'c')
+        ->fields('c', ['cv_id'])
+        ->condition('name', 'fatty acid 18')
+        ->execute()
+        ->fetchField();
+      $this->assertFalse($exists);
+
     }
 
   /**
    * @group obo
    */
 
-  public function testGO_SLIM_loads() {
+  public function testGO_SLIM_load() {
     $this->load_goslim_plant();
 
     $exists = db_select('chado.cv', 'c')