29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-25 23:02:55 +00:00

Fix JToolbarButton unit tests (#13799)

* Fix JToolbarButton unit tests

* Fix JToolbarButton unit tests

* Fix JToolbarButton unit tests
This commit is contained in:
Walt Sorensen 2017-01-29 09:51:17 -07:00 committed by Michael Babker
parent 594c50fc29
commit 80ef2839e3
3 changed files with 11 additions and 11 deletions

View File

@ -123,11 +123,11 @@ class JToolbarButtonTest extends TestCaseDatabase
{
$type = array('Standard', 'test');
$expected = "<div class=\"btn-wrapper\" id=\"toolbar-test\">" . PHP_EOL
. "\t<button onclick=\"if (document.adminForm.boxchecked.value == 0) { alert(Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')); } else { Joomla.submitbutton(''); }\" class=\"btn btn-small\">" . PHP_EOL
. "\t<span class=\"icon-test\"></span>" . PHP_EOL
. "\t</button>" . PHP_EOL
. "</div>" . PHP_EOL;
$expected = "<div class=\"btn-wrapper\" id=\"toolbar-test\">\n"
. "\t<button onclick=\"if (document.adminForm.boxchecked.value == 0) { alert(Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')); } else { Joomla.submitbutton(''); }\" class=\"btn btn-small\">\n"
. "\t<span class=\"icon-test\"></span>\n"
. "\t</button>\n"
. "</div>\n";
$this->assertEquals(
$expected,

View File

@ -92,9 +92,9 @@ class JToolbarButtonConfirmTest extends TestCaseDatabase
*/
public function testFetchButton()
{
$html = "<button onclick=\"if (document.adminForm.boxchecked.value == 0) { alert(Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')); } else { if (confirm('Confirm action?')) { Joomla.submitbutton('article.save'); } }\" class=\"btn btn-small\">" . PHP_EOL
. "\t<span class=\"icon-confirm-test\"></span>" . PHP_EOL
. "\tConfirm?</button>" . PHP_EOL;
$html = "<button onclick=\"if (document.adminForm.boxchecked.value == 0) { alert(Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')); } else { if (confirm('Confirm action?')) { Joomla.submitbutton('article.save'); } }\" class=\"btn btn-small\">\n"
. "\t<span class=\"icon-confirm-test\"></span>\n"
. "\tConfirm?</button>\n";
$this->assertEquals(
$this->object->fetchButton('Confirm', 'Confirm action?', 'confirm-test', 'Confirm?', 'article.save'),

View File

@ -94,9 +94,9 @@ class JToolbarButtonHelpTest extends TestCaseDatabase
*/
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-small\">" . PHP_EOL
. "\t<span class=\"icon-question-sign\"></span>" . PHP_EOL
. "\tJTOOLBAR_HELP</button>" . PHP_EOL;
$html = "<button onclick=\"Joomla.popupWindow('help/en-GB/JHELP_CONTENT_ARTICLE_MANAGER.html', 'JHELP', 700, 500, 1)\" rel=\"help\" class=\"btn btn-small\">\n"
. "\t<span class=\"icon-question-sign\"></span>\n"
. "\tJTOOLBAR_HELP</button>\n";
$this->assertEquals(
$this->object->fetchButton('Help', 'JHELP_CONTENT_ARTICLE_MANAGER'),