Tests for a tab and tray provided by a module implementing hook_toolbar().
function testHookToolbar() {
$this
->drupalGet('test-page');
$this
->assertResponse(200);
// Assert that the toolbar is present in the HTML.
$this
->assertRaw('id="toolbar-administration"');
// Assert that the tab registered by toolbar_test is present.
$this
->assertRaw('id="toolbar-tab-testing"');
// Assert that the tray registered by toolbar_test is present.
$this
->assertRaw('id="toolbar-tray-testing"');
}