FilesTest.php 1020 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Tests\api;
  3. use StatonLab\TripalTestSuite\DBTransaction;
  4. use StatonLab\TripalTestSuite\TripalTestCase;
  5. class FilesTest extends TripalTestCase {
  6. // Uncomment to auto start and rollback db transactions per test method.
  7. use DBTransaction;
  8. /**
  9. * Tests convert_tsv2gff3().
  10. */
  11. public function testTSV2GFF3() {
  12. // Grab the paths for `
  13. $tsv_file = DRUPAL_ROOT . '/' . drupal_get_path('module','blast_ui') . '/tests/test_files/Citrus_sinensis-orange1.1g015632m.blastresults.tsv';
  14. $gff_file = DRUPAL_ROOT . '/' . drupal_get_path('module','blast_ui') . '/tests/test_files/Citrus_sinensis-orange1.1g015632m.blastresults.gff';
  15. $result_gff = file_directory_temp() . '/' . uniqid() . '.gff';
  16. convert_tsv2gff3($tsv_file, $result_gff);
  17. $this->assertFileExists($result_gff,
  18. "Unable to find resulting GFF3 file.");
  19. $this->assertEquals(file_get_contents($gff_file), file_get_contents($result_gff),
  20. "GFF files produced did not contain the expected results.");
  21. }
  22. }