phpmyadmin/test/libraries/common/PMA_display_html_checkbox_test.php
Michal Čihař eddbee7e73 Use PHPUnit_Framework_TestCase insead of PHPUnit_Extensions_OutputTestCase
This is needed for phpunit 3.6 (otherwise it throws out tons of
warnings).
2011-12-19 14:59:42 +01:00

56 lines
1.9 KiB
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test for PMA_display_html_checkbox from common.lib.php
*
* @package PhpMyAdmin-test
* @version $Id: PMA_display_html_checkbox_test.php
* @group common.lib-tests
*/
/*
* Include to test.
*/
require_once 'libraries/common.lib.php';
class PMA_display_html_checkbox_test extends PHPUnit_Framework_TestCase
{
function testDisplayHtmlCheckbox()
{
$name = "test_display_html_checkbox";
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name, $label, false, false);
}
function testDisplayHtmlCheckboxChecked()
{
$name = "test_display_html_checkbox";
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name, $label, true, false);
}
function testDisplayHtmlCheckboxOnclick()
{
$name = "test_display_html_checkbox";
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" class="autosubmit" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name, $label, false, true);
}
function testDisplayHtmlCheckboxCheckedOnclick()
{
$name = "test_display_html_checkbox";
$label = "text_label_for_checkbox";
$this->expectOutputString('<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" class="autosubmit" /><label for="' . $name . '">' . $label . '</label>');
PMA_display_html_checkbox($name, $label, true, true);
}
}
//PMA_display_html_checkbox