mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-07 08:36:51 +01:00
* Fix "method_argument_space" * Fix "control_structure_continuation_position" * Fix "new_with_parentheses" * Fix "blank_line_before_statement" * Fix "visibility_required" * Fix some "array_indentation" * Fix some "array_indentation" - unify all "rcube::raise_error" calls * rm useless eslint ignores and add rules counts * sort eslint ignores * fix eslint ignores grammar * Revert "Fix "blank_line_before_statement"" * fix CS 3.46.0
24 lines
874 B
PHP
24 lines
874 B
PHP
<?php
|
|
|
|
/**
|
|
* Test class to test html_checkbox class
|
|
*/
|
|
class Framework_HtmlCheckbox extends PHPUnit\Framework\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));
|
|
}
|
|
}
|