Remove some fixmes from message tpls
[civicrm-core.git] / Civi / Test.php
index a0d67697470284b41d3fd5fc4909198b8659d3d0..dfa4d31c307c5d0bd08359c54502cd070275909f 100644 (file)
@@ -32,7 +32,7 @@ class Test {
     $conn = \Civi\Test::pdo();
 
     $oldEscaper = \CRM_Core_I18n::$SQL_ESCAPER;
-    \Civi::$statics['testPreInstall'] = (\Civi::$statics['testPreInstall'] ?? 0) + 1;
+    \Civi\Test::$statics['testPreInstall'] = (\Civi\Test::$statics['testPreInstall'] ?? 0) + 1;
     try {
       \CRM_Core_I18n::$SQL_ESCAPER = function ($text) use ($conn) {
         return substr($conn->quote($text), 1, -1);
@@ -40,9 +40,9 @@ class Test {
       return $callback();
     } finally {
       \CRM_Core_I18n::$SQL_ESCAPER = $oldEscaper;
-      \Civi::$statics['testPreInstall']--;
-      if (\Civi::$statics['testPreInstall'] <= 0) {
-        unset(\Civi::$statics['testPreInstall']);
+      \Civi\Test::$statics['testPreInstall']--;
+      if (\Civi\Test::$statics['testPreInstall'] <= 0) {
+        unset(\Civi\Test::$statics['testPreInstall']);
       }
     }
   }
@@ -50,7 +50,7 @@ class Test {
   /**
    * Get the data source used for testing.
    *
-   * @param string|NULL $part
+   * @param string|null $part
    *   One of NULL, 'hostspec', 'port', 'username', 'password', 'database'.
    * @return string|array|NULL
    *   If $part is omitted, return full DSN array.
@@ -117,7 +117,7 @@ class Test {
           throw new \RuntimeException("\\Civi\\Test::headless() requires CIVICRM_UF=UnitTests");
         }
         $dbName = \Civi\Test::dsn('database');
-        echo "Installing {$dbName} schema\n";
+        fprintf(STDERR, "Installing {$dbName} schema\n");
         \Civi\Test::schema()->dropAll();
       }, 'headless-drop')
       ->coreSchema()
@@ -166,6 +166,7 @@ class Test {
     if (!isset(self::$singletons['codeGen'])) {
       $civiRoot = str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__));
       $codeGen = new \CRM_Core_CodeGen_Main("$civiRoot/CRM/Core/DAO", "$civiRoot/sql", $civiRoot, "$civiRoot/templates", NULL, "UnitTests", NULL, "$civiRoot/xml/schema/Schema.xml", NULL);
+      $codeGen->setVerbose(FALSE);
       $codeGen->init();
       self::$singletons['codeGen'] = $codeGen;
     }