Browse Source

Forgot to add files

Stephen Ficklin 6 years ago
parent
commit
61f72e6cdd

+ 50 - 0
tests/tripal_chado/api/OBOImporterTest.php

@@ -0,0 +1,50 @@
+<?php
+namespace Tests\tripal_chado\api;
+
+use StatonLab\TripalTestSuite\DBTransaction;
+use StatonLab\TripalTestSuite\TripalTestCase;
+
+module_load_include('inc', 'tripal_chado', 'includes/TripalImporter/OBOImporter.inc');
+
+
+class OBOImporterTest extends TripalTestCase {
+  
+  use DBTransaction;
+    
+  /**
+   * Tests that the OBO loader can import from a remote OBO.  
+   *
+   * @group api
+   * @group chado
+   * @group obo
+   * 
+   */
+  public function testRemoteRemote() {
+    
+    // Make sure the sequence ontology OBO is there.
+    chado_insert_obo('sequence', 'http://purl.obolibrary.org/obo/so.obo');
+        
+    // The loader is an instance of TripalImporter which
+    // requires a job. So let's create one.
+    $so = new TripalJob;
+    $so->create([
+      'job_name' => 'OBO test',
+      'modulename' => 'tripal_chado',
+      'callback' => 'NA',
+      'arguments' => [
+        'obo_id' => chado_get_obo('sequence'),
+      ],
+      'uid' => 1,
+      'priority' => 10,
+      'includes' => []]);
+      
+      return [
+        $so,
+      ];
+    
+    $loader = new \OBOImporter($job);
+    $loader->run();
+    
+    $check_sql = "SELECT count(*) FROM " 
+  }
+}

+ 121 - 0
tests/tripal_chado/example_files/cvtermpath_test.obo

@@ -0,0 +1,121 @@
+format-version: 1.2
+default-namespace: cvtermpath_test
+ontology: cvtp
+subsetdef: test_normal "Normal nodes"
+subsetdef: test_crazy "Crazy nodes"
+
+[Term]
+id: CVTP:001
+name: node01
+def: This is node 1
+subset: test_normal
+
+[Term]
+id: CVTP:002
+name: node02
+is_a: CVTP:001
+def: This is node 2
+subset: test_normal
+
+[Term]
+id: CVTP:003
+name: node03
+is_a: CVTP:001
+def: This is node 3
+subset: test_normal
+
+[Term]
+id: CVTP:004
+name: node04
+is_a: CVTP:001
+def: This is node 4
+subset: test_normal
+relationship: has_part CVTP:011
+
+
+[Term]
+id: CVTP:005
+name: node05
+is_a: CVTP:001
+def: This is node 5
+subset: test_normal
+
+[Term]
+id: CVTP:006
+name: node06
+is_a: CVTP:003
+def: This is node 6
+subset: test_normal
+
+[Term]
+id: CVTP:007
+name: node07
+is_a: CVTP:003
+def: This is node 7
+subset: test_normal
+
+[Term]
+id: CVTP:008
+name: node08
+is_a: CVTP:007
+def: This is node 8
+subset: test_normal
+
+[Term]
+id: CVTP:009
+name: node09
+is_a: CVTP:004
+is_a: CVTP:007
+def: This is node 9
+subset: test_normal
+
+[Term]
+id: CVTP:010
+name: node10
+is_a: CVTP:005
+def: This is node 10
+subset: test_normal
+
+[Term]
+id: CVTP:011
+name: node11
+is_a: CVTP:009
+is_a: CVTP:010
+def: This is node 11
+synonym: "crazy node" EXACT []
+xref: GO:0043226
+subset: test_crazy
+
+
+[Term]
+id: CVTP:012
+name: node12
+is_a: CVTP:010
+def: This is node 12
+subset: test_normal
+
+[Term]
+id: CVTP:013
+name: node13
+is_a: CVTP:011
+def: This is node 13
+subset: test_normal
+
+[Term]
+id: CVTP:014
+name: node14
+is_obsolete: true
+def: This is node 14
+
+[Typedef]
+id: has_part
+name: has_part
+namespace: external
+xref: BFO:0000051
+is_transitive: true
+
+
+
+
+
+