/**
 * Override theme_status_messages()
 **/
function zurb_foundation_6_status_messages($variables)
{
    $display = $variables['display'];
    $output = '';
    $status_heading = array('status' => t('Status message'), 'error' => t('Error message'), 'warning' => t('Warning message'));
    foreach (backdrop_get_messages($display) as $type => $messages) {
        //convert to foundation classes
        switch ($type) {
            case 'error':
                $type = 'alert';
                break;
            case 'status':
                $type = 'success';
                break;
            case 'warning':
                $type = 'secondary';
                break;
        }
        $output .= "<div data-alert class=\"alert-box {$type}\">\n";
        if (!empty($status_heading[$type])) {
            $output .= '<h2 class="element-invisible">' . $status_heading[$type] . "</h2>\n";
        }
        if (count($messages) > 1) {
            $output .= " <ul>\n";
            foreach ($messages as $message) {
                $output .= '  <li>' . $message . "</li>\n";
            }
            $output .= " </ul>\n";
        } else {
            $output .= $messages[0];
        }
        $output .= '<a href="#" class="close">&times;</a></div>';
    }
    return $output;
}
 /**
  * Run all tests in this class.
  *
  * Regardless of whether $methods are passed or not, only method names
  * starting with "test" are executed.
  *
  * @param $methods
  *   (optional) A list of method names in the test case class to run; e.g.,
  *   array('testFoo', 'testBar'). By default, all methods of the class are
  *   taken into account, but it can be useful to only run a few selected test
  *   methods during debugging.
  */
 public function run(array $methods = array())
 {
     $config = config('simpletest.settings');
     // Initialize verbose debugging.
     simpletest_verbose(NULL, config_get('system.core', 'file_public_path'), get_class($this));
     // HTTP auth settings (<username>:<password>) for the simpletest browser
     // when sending requests to the test site.
     $this->httpauth_method = $config->get('simpletest_method');
     $username = $config->get('simpletest_username', NULL);
     $password = $config->get('simpletest_password', NULL);
     if (!empty($username) && !empty($password)) {
         $this->httpauth_credentials = $username . ':' . $password;
     }
     set_error_handler(array($this, 'errorHandler'));
     $class = get_class($this);
     // Iterate through all the methods in this class, unless a specific list of
     // methods to run was passed.
     $class_methods = get_class_methods($class);
     if ($methods) {
         $class_methods = array_intersect($class_methods, $methods);
     }
     $missing_requirements = $this->checkRequirements();
     if (!empty($missing_requirements)) {
         $missing_requirements_object = new ReflectionObject($this);
         $caller = array('file' => $missing_requirements_object->getFileName());
         foreach ($missing_requirements as $missing_requirement) {
             BackdropTestCase::insertAssert($this->testId, $class, FALSE, $missing_requirement, 'Requirements check.', $caller);
         }
     } else {
         foreach ($class_methods as $method) {
             // If the current method starts with "test", run it - it's a test.
             if (strtolower(substr($method, 0, 4)) == 'test') {
                 // Insert a fail record. This will be deleted on completion to ensure
                 // that testing completed.
                 $method_info = new ReflectionMethod($class, $method);
                 $caller = array('file' => $method_info->getFileName(), 'line' => $method_info->getStartLine(), 'function' => $class . '->' . $method . '()');
                 $completion_check_id = BackdropTestCase::insertAssert($this->testId, $class, FALSE, t('The test did not complete due to a fatal error.'), 'Completion check', $caller);
                 $this->setUp();
                 if ($this->setup) {
                     try {
                         $this->{$method}();
                         // Finish up.
                     } catch (Exception $e) {
                         $this->exceptionHandler($e);
                     }
                     $this->tearDown();
                 } else {
                     $this->fail(t("The test cannot be executed because it has not been set up properly."));
                 }
                 // Remove the completion check record.
                 BackdropTestCase::deleteAssert($completion_check_id);
             }
         }
     }
     // Clear out the error messages and restore error handler.
     backdrop_get_messages();
     restore_error_handler();
 }
#!/usr/bin/env php
<?php 
## usage: module-enable.php <module_a> <module_b> ...
ini_set('display_errors', 1);
$_SERVER['HTTP_HOST'] = 'default';
$_SERVER['PHP_SELF'] = '/index.php';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_SOFTWARE'] = NULL;
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['QUERY_STRING'] = '';
$_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'] = '/';
$_SERVER['HTTP_USER_AGENT'] = 'console';
define('BACKDROP_ROOT', '.');
require_once 'core/includes/bootstrap.inc';
backdrop_bootstrap(BACKDROP_BOOTSTRAP_FULL);
$modules = $argv;
$program = array_shift($modules);
if (empty($modules)) {
    echo "usage: {$program} <module_a> <module_b> ...\n";
    exit(0);
} else {
    printf("[[ Enable %s ]]\n", implode(', ', $modules));
    module_enable($modules);
    backdrop_flush_all_caches();
    $messages = backdrop_get_messages();
    if (!empty($messages)) {
        print_r($messages);
    }
}