Browse Source

reorder tests

Bradford Condon 6 years ago
parent
commit
cfeb0f61e2

+ 6 - 6
composer.lock

@@ -1538,16 +1538,16 @@
         },
         {
             "name": "symfony/polyfill-mbstring",
-            "version": "v1.7.0",
+            "version": "v1.8.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-mbstring.git",
-                "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
-                "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171",
                 "shasum": ""
             },
             "require": {
@@ -1559,7 +1559,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.7-dev"
+                    "dev-master": "1.8-dev"
                 }
             },
             "autoload": {
@@ -1593,7 +1593,7 @@
                 "portable",
                 "shim"
             ],
-            "time": "2018-01-30T19:27:44+00:00"
+            "time": "2018-04-26T10:06:28+00:00"
         },
         {
             "name": "theseer/tokenizer",

+ 21 - 0
tests/tripal/api/TripalJobsApiTest.php

@@ -0,0 +1,21 @@
+<?php
+
+
+use StatonLab\TripalTestSuite\DBTransaction;
+use StatonLab\TripalTestSuite\TripalTestCase;
+
+class TripalJobsApiTest extends TripalTestCase {
+
+  use DBTransaction;
+
+  /**
+   * Tests the ability to create a tripal job.
+   *
+   * @test
+   */
+  public function should_create_a_tripal_job() {
+    $job_id = tripal_add_job('Test adding jobs', 'tripal', 'tripal_tripal_cron_notification', [], 1);
+    $this->assertTrue(is_numeric($job_id));
+
+  }
+}

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

@@ -0,0 +1,39 @@
+<?php
+
+
+use StatonLab\TripalTestSuite\DBTransaction;
+use StatonLab\TripalTestSuite\TripalTestCase;
+
+class TripalChadoAPITest extends TripalTestCase {
+
+  use DBTransaction;
+
+
+  /**
+   *
+   *@test
+   */
+
+  public function test_tripal_chado_publish_records(){
+
+    //create an organism, publish it
+    $organism = factory('chado.organism')->create([
+      'genus' => 'a_genius_genus',
+      'species' => 'fake_species',
+    ]);
+    //get bundle ID for organism
+    $bundle = db_select('public.chado_bundle', 'CB')
+    ->fields('CB', ['bundle_id'])
+    ->condition('data_table', 'organism')
+    ->execute()->fetchField();
+
+    $values = ['bundle_name' => 'bio_data_' . $bundle];
+
+    ob_start();//dont display the job message
+    $bool = tripal_chado_publish_records($values);
+    ob_end_clean();
+
+    $this->assertTrue($bool, 'Publishing a fake organism record failed');
+}
+
+}