Browse Source

Merge pull request #21 from statonlab/add-namespace

Add name spaceing
Abdullah Almsaeed 6 years ago
parent
commit
c2798876c2

+ 4 - 2
composer.json

@@ -1,6 +1,8 @@
 {
   "require-dev": {
-    "doctrine/instantiator": "1.0.*",
-    "statonlab/tripal-test-suite": "~1.0.0"
+    "doctrine/instantiator": "1.0.*"
+  },
+  "require": {
+    "statonlab/tripal-test-suite": "1.0.*"
   }
 }

+ 17 - 17
composer.lock

@@ -4,37 +4,36 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "686eb1e397fb7cea824cd9c910a6ab5c",
-    "packages": [],
-    "packages-dev": [
+    "content-hash": "6b7fddf464c4d4d28fc77f805792807d",
+    "packages": [
         {
             "name": "doctrine/instantiator",
-            "version": "1.1.0",
+            "version": "1.0.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/doctrine/instantiator.git",
-                "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
+                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
-                "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
+                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
                 "shasum": ""
             },
             "require": {
-                "php": "^7.1"
+                "php": ">=5.3,<8.0-DEV"
             },
             "require-dev": {
                 "athletic/athletic": "~0.1.8",
                 "ext-pdo": "*",
                 "ext-phar": "*",
-                "phpunit/phpunit": "^6.2.3",
-                "squizlabs/php_codesniffer": "^3.0.2"
+                "phpunit/phpunit": "~4.0",
+                "squizlabs/php_codesniffer": "~2.0"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.2.x-dev"
+                    "dev-master": "1.0.x-dev"
                 }
             },
             "autoload": {
@@ -59,7 +58,7 @@
                 "constructor",
                 "instantiate"
             ],
-            "time": "2017-07-22T11:58:36+00:00"
+            "time": "2015-06-14T21:17:01+00:00"
         },
         {
             "name": "fzaninotto/faker",
@@ -1654,16 +1653,16 @@
         },
         {
             "name": "statonlab/tripal-test-suite",
-            "version": "1.0.0",
+            "version": "1.0.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/statonlab/TripalTestSuite.git",
-                "reference": "f70eb463c90d63fc1fbef8c568638bc460ceeda4"
+                "reference": "2d09cd7565a82f16cc4bba7411bc32e2553cb92c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/statonlab/TripalTestSuite/zipball/f70eb463c90d63fc1fbef8c568638bc460ceeda4",
-                "reference": "f70eb463c90d63fc1fbef8c568638bc460ceeda4",
+                "url": "https://api.github.com/repos/statonlab/TripalTestSuite/zipball/2d09cd7565a82f16cc4bba7411bc32e2553cb92c",
+                "reference": "2d09cd7565a82f16cc4bba7411bc32e2553cb92c",
                 "shasum": ""
             },
             "require": {
@@ -1698,7 +1697,7 @@
                     "email": "bcondon@utk.edu"
                 }
             ],
-            "time": "2018-05-01T14:41:06+00:00"
+            "time": "2018-05-02T15:51:28+00:00"
         },
         {
             "name": "symfony/console",
@@ -1918,6 +1917,7 @@
             "time": "2018-01-29T19:49:41+00:00"
         }
     ],
+    "packages-dev": [],
     "aliases": [],
     "minimum-stability": "stable",
     "stability-flags": [],

+ 1 - 1
tests/tripal/api/TripalJobsApiTest.php

@@ -1,5 +1,5 @@
 <?php
-
+namespace Tests\tripal\api;
 
 use StatonLab\TripalTestSuite\DBTransaction;
 use StatonLab\TripalTestSuite\TripalTestCase;

+ 1 - 0
tests/tripal_chado/api/TripalChadoAPITest.php

@@ -1,4 +1,5 @@
 <?php
+namespace Tests\tripal_chado\api;
 
 
 use StatonLab\TripalTestSuite\DBTransaction;

+ 5 - 4
tests/tripal_chado/api/TripalChadoOrganismAPITest.php

@@ -1,5 +1,6 @@
 <?php
 
+namespace Tests\tripal_chado\api;
 
 use StatonLab\TripalTestSuite\DBTransaction;
 use StatonLab\TripalTestSuite\TripalTestCase;
@@ -38,6 +39,10 @@ class TripalChadoOrganismAPITest extends TripalTestCase {
     }
   }
 
+  /**
+   * Test tripal_get_organism doesn't return anything
+   * when the organism doesn't exist.
+   */
   public function test_tripal_get_organism_fails_gracefully() {
     $result = tripal_get_organism([
       'genus' => uniqid(),
@@ -53,7 +58,6 @@ class TripalChadoOrganismAPITest extends TripalTestCase {
    * @group  api
    */
   function test_tripal_get_organism_scientific_name() {
-
     $genus_string = 'a_genius_genus';
     $species_string = 'fake_species';
     $infraspecific_name = "infrawhat?";
@@ -73,7 +77,6 @@ class TripalChadoOrganismAPITest extends TripalTestCase {
       $term->name,
       $infraspecific_name,
     ]), $sci_name);
-
   }
 
   //TODO: Can't test because it uses drupal_json_output.
@@ -107,6 +110,4 @@ class TripalChadoOrganismAPITest extends TripalTestCase {
   //    $this->assertGreaterThan(20, count($options));
   //
   //  }
-
-
 }

+ 1 - 1
tripal_chado/api/modules/tripal_chado.organism.api.inc

@@ -300,7 +300,7 @@ function tripal_autocomplete_organism($text) {
   $sql .= "ORDER BY genus, species ";
   $sql .= "LIMIT 25 OFFSET 0 ";
   $results = chado_query($sql, $args);
-  $items = array();
+  $items = array(['args' => [$sql => $args]]);
   foreach ($results as $organism) {
     $name = tripal_get_organism_scientific_name($organism);
     $items["$name [id: $organism->organism_id]"] = $name;