OBOImporterTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Tests\tripal_chado\api;
  3. use StatonLab\TripalTestSuite\DBTransaction;
  4. use StatonLab\TripalTestSuite\TripalTestCase;
  5. module_load_include('inc', 'tripal_chado', 'includes/TripalImporter/OBOImporter.inc');
  6. class OBOImporterTest extends TripalTestCase {
  7. use DBTransaction;
  8. /**
  9. * Tests that the OBO loader can import from a remote OBO.
  10. *
  11. * @group api
  12. * @group chado
  13. * @group obo
  14. *
  15. */
  16. public function testRemoteRemote() {
  17. // Make sure the sequence ontology OBO is there.
  18. chado_insert_obo('sequence', 'http://purl.obolibrary.org/obo/so.obo');
  19. // The loader is an instance of TripalImporter which
  20. // requires a job. So let's create one.
  21. $so = new TripalJob;
  22. $so->create([
  23. 'job_name' => 'OBO test',
  24. 'modulename' => 'tripal_chado',
  25. 'callback' => 'NA',
  26. 'arguments' => [
  27. 'obo_id' => chado_get_obo('sequence'),
  28. ],
  29. 'uid' => 1,
  30. 'priority' => 10,
  31. 'includes' => []]);
  32. return [
  33. $so,
  34. ];
  35. $loader = new \OBOImporter($job);
  36. $loader->run();
  37. $check_sql = "SELECT count(*) FROM "
  38. }
  39. }