Issue #1706878 by tim.plunkett, lazysoundsystem: Add WebTestBase::assertThemeOutput() to allow modules to test theme function output.

8.0.x
webchick 2012-10-05 21:20:32 -07:00
parent c26c3117f1
commit ebb1e56c2e
1 changed files with 4 additions and 1 deletions

View File

@ -2344,6 +2344,9 @@ abstract class WebTestBase extends TestBase {
* The expected themed output string.
* @param $message
* (optional) An assertion message.
*
* @return
* TRUE on pass, FALSE on fail.
*/
protected function assertThemeOutput($callback, array $variables = array(), $expected, $message = '') {
$output = theme($callback, $variables);
@ -2356,7 +2359,7 @@ abstract class WebTestBase extends TestBase {
$message = '%callback rendered correctly.';
}
$message = format_string($message, array('%callback' => 'theme_' . $callback . '()'));
$this->assertIdentical($output, $expected, $message);
return $this->assertIdentical($output, $expected, $message);
}
/**