How to inspect a variable when testing with `drush test-run`.
Call DrupalTestCase::assert() passing the message to show.

$this-&gt;assert(TRUE,
  t('Variable content: @variable', array('@variable' =&gt; var_export($variable, TRUE))
);


This is similar to the code used by DrupalTestCase::assertIdentical(). The difference is that in your case the first argument is TRUE because you are just outputting the content of a variable, which never fails.

protected function assertIdentical($first, $second, $message = '', $group = 'Other') {
  return $this-&gt;assert($first === $second, $message ? $message : t('Value @first is identical to value @second.', array('@first' =&gt; var_export($first, TRUE), '@second' =&gt; var_export($second, TRUE))), $group);
}