Skip to content

Commit

Permalink
ToStringTest: add test for invalid string
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanmac committed Aug 19, 2024
1 parent 3f608de commit 2e40af1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/Form/DataTransformer/ToStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@
class ToStringTest extends TestCase
{
public function testInvalidReverseTransform(): void
{
$this->invalidReverseTransform(new stdClass());
}

public function testInvalidCronReverseTransform(): void
{
$this->invalidReverseTransform("* * * * * *");
}

/**
* @param mixed $value
*/
protected function invalidReverseTransform($value): void
{
$transformer = new CronExpressionToStringTransformer();
$this->expectException(TransformationFailedException::class);
$transformer->reverseTransform(new stdClass());
$transformer->reverseTransform($value);
}
}

0 comments on commit 2e40af1

Please sign in to comment.