Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ibelar committed May 31, 2023
1 parent fde0e0e commit ce5fb82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
],
'php_unit_strict' => false,
'php_unit_test_class_requires_covers' => false,
'phpdoc_add_missing_param_annotation' => false,
'return_assignment' => false,
Expand Down
10 changes: 5 additions & 5 deletions tests/Views/InputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ public function testCalendarValue(): void

$dateInput->setWithPostValue('2023-05-22');
$date = \DateTime::createFromFormat('Y-m-d', '2023-05-22', new \DateTimeZone('UTC'));
$this->assertSame($date, $dateInput->getValue());
$this->assertEquals($date, $dateInput->getValue());

$dateInput->setValue(\DateTime::createFromFormat('Y-m-d', '2023-06-22', new \DateTimeZone('UTC')));
$this->assertSame('2023-06-22', $dateInput->getInputValue());
$this->assertEquals('2023-06-22', $dateInput->getInputValue());

$dateTimeInput = new Calendar(['type' => 'datetime', 'format' => 'Y-m-d H:i']);
$datetime = \DateTime::createFromFormat('Y-m-d', '2023-05-22 12:05', new \DateTimeZone('UTC'));
$this->assertSame($datetime, $dateTimeInput->getValue());
$this->assertEquals($datetime, $dateTimeInput->getValue());

$dateTimeInput->setValue(\DateTime::createFromFormat('Y-m-d H:i', '2023-06-22 12:05', new \DateTimeZone('UTC')));
$this->assertSame('2023-06-22 12:05', $dateTimeInput->getInputValue());
$this->assertEquals('2023-06-22 12:05', $dateTimeInput->getInputValue());
}

public function testGetRadioValue(): void
Expand All @@ -121,7 +121,7 @@ public function testGetNumberValue(): void
{
$int = new Number(['controlName' => 'int']);
$int->setValue(12);
$this->assertSame('12', $int->getInputValue());
$this->assertSame(12, $int->getInputValue());

$int->setWithPostValue('12');
$this->assertSame(12, $int->getValue());
Expand Down

0 comments on commit ce5fb82

Please sign in to comment.