| Total Complexity | 2 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class DateTest extends CommonTestClass |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @throws RenderException |
||
| 15 | */ |
||
| 16 | public function testDate(): void |
||
| 17 | { |
||
| 18 | $input = new Controls\DatePicker(); |
||
| 19 | $input->set('commit', 'original', 'not to look'); |
||
| 20 | $this->assertEquals('<input type="text" value="" class="datepicker" id="commit" name="commit" />', $input->renderInput()); |
||
| 21 | $input->setValue(1333571265); |
||
| 22 | $input->setDateFormat('Y-m-d H:i'); |
||
| 23 | $this->assertEquals('<input type="text" value="2012-04-04 20:27" class="datepicker" id="commit" name="commit" />', $input->renderInput()); |
||
| 24 | $input->setValue('2010-08-18 22:33'); |
||
| 25 | $this->assertEquals('<input type="text" value="2010-08-18 22:33" class="datepicker" id="commit" name="commit" />', $input->renderInput()); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @throws RenderException |
||
| 30 | */ |
||
| 31 | public function testRange(): void |
||
| 32 | { |
||
| 33 | $input = new Range(); |
||
| 34 | $input->resetUniq(); |
||
| 35 | $input->set('myown', 'original', 'not to look'); |
||
| 36 | $this->assertEquals( |
||
| 37 | ' <input type="text" value="" class="datepicker" id="myown_0" name="myown[]" /> '. PHP_EOL |
||
| 38 | . ' <input type="text" value="" class="datepicker" id="myown_1" name="myown[]" /> ', $input->renderInput()); |
||
| 39 | } |
||
| 53 |