Files
roundcubemail/tests/Framework/HtmlCheckbox.php
Michael Voříšek 54f4aa33f9 Fix CS - imports (#9316)
* 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
2024-01-21 19:13:31 +01:00

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));
}
}