Browse Source

use strlower in the suppress error check

Bradford Condon 6 years ago
parent
commit
f3c59601b5

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

@@ -53,7 +53,7 @@ class TripalChadoAPITest extends TripalTestCase {
     putenv("TRIPAL_SUPPRESS_ERRORS=TRUE");//this will fail, so we suppress the tripal error reporter
     $bool = tripal_chado_publish_records(['bundle_name' => 'never_in_a_million_years']);
     $this->assertFalse($bool);
-    putenv("APP_ENV");//unset
+    putenv("TRIPAL_SUPPRESS_ERRORS");//unset
   }
 
   /**

+ 19 - 0
tests/tripal_chado/api/TripalChadoCustomTablesAPITest.php

@@ -0,0 +1,19 @@
+<?php
+namespace Tests\tripal_chado\api;
+
+use StatonLab\TripalTestSuite\DBTransaction;
+use StatonLab\TripalTestSuite\TripalTestCase;
+
+class TripalChadoCustomTablesAPITest extends TripalTestCase {
+  // Uncomment to auto start and rollback db transactions per test method.
+  // use DBTransaction;
+
+  /**
+   * Basic test example.
+   * Tests must begin with the word "test".
+   * See https://phpunit.readthedocs.io/en/latest/ for more information.
+   */
+  public function testBasicExample() {
+    $this->assertTrue(true);
+  }
+}

+ 3 - 1
tripal/api/tripal.notice.api.inc

@@ -63,7 +63,9 @@ define('TRIPAL_DEBUG',7);
  */
 function tripal_report_error($type, $severity, $message, $variables = array(), $options = array()) {
 
-  if(getenv('TRIPAL_SUPPRESS_ERRORS') === 'TRUE') return;
+  $suppress = getenv('TRIPAL_SUPPRESS_ERRORS');
+
+  if(strtolower($suppress) === 'true') return;
 
   // Get human-readable severity string
   $severity_string = '';