Skip to content

Commit

Permalink
Fixing Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hunziker committed Jun 21, 2017
1 parent f41088d commit 3ec6e16
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testRender()
{
$type = array('Standard', 'test');

$expected = "\n<button onclick=\"if (document.adminForm.boxchecked.value == 0) { Joomla.renderMessages({'error': [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}) } else { Joomla.submitbutton(''); }\" class=\"btn btn-sm btn-outline-primary\">\n\t<span class=\"icon-test\" aria-hidden=\"true\"></span>\n\t</button>\n";
$expected = "\n<button id=\"toolbar-test\" onclick=\"if (document.adminForm.boxchecked.value == 0) { Joomla.renderMessages({'error': [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}) } else { Joomla.submitbutton(''); }\" class=\"btn btn-sm btn-outline-primary\">\n\t<span class=\"icon-test\" aria-hidden=\"true\"></span>\n\t</button>\n";

$this->assertEquals(
$expected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ protected function tearDown()
*/
public function testFetchButton()
{
$html = "<button onclick=\"if (document.adminForm.boxchecked.value == 0) { Joomla.renderMessages({'error': [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}) } else { if (confirm('Confirm action?')) { Joomla.submitbutton('article.save'); } }\" class=\"btn btn-sm btn-outline-danger\">\n"
$html = "<button id=\"toolbar-\" onclick=\"if (document.adminForm.boxchecked.value == 0) { Joomla.renderMessages({'error': [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}) } else { if (confirm('Confirm action?')) { Joomla.submitbutton('article.save'); } }\" class=\"btn btn-sm btn-outline-danger\">\n"
. "\t<span class=\"icon-confirm-test\" aria-hidden=\"true\"></span>\n"
. "\tConfirm?</button>\n";


$this->assertEquals(
$this->object->fetchButton('Confirm', 'Confirm action?', 'confirm-test', 'Confirm?', 'article.save'),
$html
$html,
$this->object->fetchButton('Confirm', 'Confirm action?', 'confirm-test', 'Confirm?', 'article.save')
);
}

Expand All @@ -113,8 +113,8 @@ public function testFetchButton()
public function testFetchId()
{
$this->assertEquals(
$this->object->fetchId('confirm', 'Message to render', 'test'),
'toolbar-test'
'toolbar-test',
$this->object->fetchId('confirm', 'Message to render', 'test')
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ protected function tearDown()
*/
public function testFetchButton()
{
$html = "<button onclick=\"Joomla.popupWindow('help/en-GB/JHELP_CONTENT_ARTICLE_MANAGER.html', 'JHELP', 700, 500, 1)\" rel=\"help\" class=\"btn btn-outline-info btn-sm\">\n"
$html = "<button id=\"toolbar-help\" onclick=\"Joomla.popupWindow('help/en-GB/JHELP_CONTENT_ARTICLE_MANAGER.html', 'JHELP', 700, 500, 1)\" rel=\"help\" class=\"btn btn-outline-info btn-sm\">\n"
. "\t<span class=\"icon-question-sign\" aria-hidden=\"true\"></span>\n"
. "\tJTOOLBAR_HELP</button>\n";

$this->assertEquals(
$this->object->fetchButton('Help', 'JHELP_CONTENT_ARTICLE_MANAGER'),
$html
$html,
$this->object->fetchButton('Help', 'JHELP_CONTENT_ARTICLE_MANAGER')
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testFetchButton()
$url = 'https://www.joomla.org';

$this->assertRegExp(
'#<button onclick="location.href=\'' . preg_quote($url, '#') . '\';" class="btn btn-outline-danger btn-sm">\s*'
'#<button id="toolbar-jdotorg" onclick="location.href=\'' . preg_quote($url, '#') . '\';" class="btn btn-outline-danger btn-sm">\s*'
. '<span class="icon-' . preg_quote($name, '#') . '" aria-hidden=\"true\"></span>\s+' . preg_quote($text, '#') . '\s*'
. '</button>\s*#',
$this->object->fetchButton('Link', $name, $text, $url)
Expand Down

0 comments on commit 3ec6e16

Please sign in to comment.