Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #30596 [Tests] fixed compatbility of assertEquals(): void (Heah…
…Dude) This PR was merged into the 3.4 branch. Discussion ---------- [Tests] fixed compatbility of assertEquals(): void | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | ~ Same as #30474. Commits ------- 3f7bedc [Tests] fixed compatbility of assertEquals(): void
- Loading branch information
Showing
4 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ymfony/Component/Form/Tests/Extension/Core/DataTransformer/Traits/DateTimeEqualsTrait.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer\Traits; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
trait DateTimeEqualsTrait | ||
{ | ||
public static function assertDateTimeEquals($expected, $actual) | ||
{ | ||
if ($expected instanceof \DateTime && $actual instanceof \DateTime) { | ||
$expected = $expected->format('c'); | ||
$actual = $actual->format('c'); | ||
} | ||
|
||
parent::assertEquals($expected, $actual); | ||
} | ||
} |