protected function ShareMessageViewModesTest::assertShareButtons in Share Message 7
Checks the markup of the share links wrapper.
Parameters
$sharemessage: The edit array of a ShareMessage as passed to drupalPost().
bool $addthis_attributes: Flag indicating whether or not to check for AddThis attributes.
bool $invert: Set to true to invert the assertion, for example to make sure the share links don't get rendered.
1 call to ShareMessageViewModesTest::assertShareButtons()
- ShareMessageViewModesTest::testShareMessageViewModes in tests/
sharemessage.test - Checks whether view modes render expected markup.
File
- tests/
sharemessage.test, line 298 - ShareMessage tests.
Class
Code
protected function assertShareButtons($sharemessage, $addthis_attributes = FALSE, $invert = FALSE) {
$raw_html_icon_style = '<div class="addthis_toolbox addthis_default_style addthis_16x16_style"';
if ($addthis_attributes) {
$raw_html_icon_style .= ' addthis:url="' . $sharemessage['sharemessage_url[und][0][value]'];
$raw_html_icon_style .= '" addthis:title="' . $sharemessage['sharemessage_title[en][0][value]'];
$raw_html_icon_style .= '" addthis:description="' . $sharemessage['sharemessage_long[en][0][value]'] . '"';
}
$raw_html_icon_style .= '>';
if ($invert) {
$this
->assertNoRaw($raw_html_icon_style);
}
else {
$this
->assertRaw($raw_html_icon_style);
}
}