本文整理汇总了PHP中JMS\Serializer\SerializerInterface::shouldReceive方法的典型用法代码示例。如果您正苦于以下问题:PHP SerializerInterface::shouldReceive方法的具体用法?PHP SerializerInterface::shouldReceive怎么用?PHP SerializerInterface::shouldReceive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JMS\Serializer\SerializerInterface
的用法示例。
在下文中一共展示了SerializerInterface::shouldReceive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_can_serialize_with_context_and_format
/**
* @test
*/
public function it_can_serialize_with_context_and_format()
{
$format = 'yml';
$context = Mock::mock(SerializationContext::class);
$this->jmsSerializer->shouldReceive('serialize')->once()->with([1234], $format, $context);
$serializer = new JmsSerializer($this->jmsSerializer, $format, $context);
$serializer->serialize([1234]);
}
示例2: test_it_delegate_find_all_to_api
public function test_it_delegate_find_all_to_api()
{
$this->whenIWorkApi->shouldReceive('usersListingUsers')->once();
$this->serializer->shouldReceive('deserialize')->once();
$this->userRepository->findAll();
}