Skip to content

Commit

Permalink
Merge 4a40941 into eae8f5d
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Jan 21, 2020
2 parents eae8f5d + 4a40941 commit e89f3e2
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/Command/Queue/Serializer/SymfonySerializerTest.php
Expand Up @@ -93,4 +93,33 @@ public function testDeserialize(?string $format, string $expected_format): void

$this->assertSame($result, $serializer->deserialize($data));
}

/**
* @dataProvider formats
*
* @param string|null $format
* @param string $expected_format
*/
public function testFailedDeserialize(?string $format, string $expected_format): void
{
$this->expectException(\RuntimeException::class);

$data = 'foo';
$result = 'bar';

$this->serializer
->expects($this->once())
->method('deserialize')
->with($data, Command::class, $expected_format)
->willReturn($result)
;

if ($format) {
$serializer = new SymfonySerializer($this->serializer, $format);
} else {
$serializer = new SymfonySerializer($this->serializer);
}

$this->assertSame($result, $serializer->deserialize($data));
}
}

0 comments on commit e89f3e2

Please sign in to comment.