mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-05 07:44:01 +01:00
* fix Tests\Browser\TestCase imports * fix remaining imports * fix PHPUnit\Framework\TestCase imports * import GuzzleHttp\Client * fix remaining * "php_unit_method_casing" is not todo * fix "single_line_comment_spacing" * fix 2nd commit done using older fixer
26 lines
889 B
PHP
26 lines
889 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* Test class to test html_checkbox class
|
|
*/
|
|
class Framework_HtmlCheckbox extends TestCase
|
|
{
|
|
/**
|
|
* Class constructor
|
|
*/
|
|
public function test_checked_state()
|
|
{
|
|
$input = new html_checkbox(['value' => 1]);
|
|
|
|
$this->assertSame('<input value="1" type="checkbox">', $input->show(0));
|
|
$this->assertSame('<input value="1" type="checkbox">', $input->show('0'));
|
|
$this->assertSame('<input value="1" checked="checked" type="checkbox">', $input->show(1));
|
|
$this->assertSame('<input value="1" checked="checked" type="checkbox">', $input->show('1'));
|
|
$this->assertSame('<input value="1" checked="checked" type="checkbox">', $input->show(true));
|
|
// test that the checked state does not "leak"
|
|
$this->assertSame('<input value="1" type="checkbox">', $input->show(0));
|
|
}
|
|
}
|