本文整理汇总了PHP中Prophecy\Prophecy\ObjectProphecy::find方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectProphecy::find方法的具体用法?PHP ObjectProphecy::find怎么用?PHP ObjectProphecy::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prophecy\Prophecy\ObjectProphecy
的用法示例。
在下文中一共展示了ObjectProphecy::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testItHydrateDataboxWhenInCache
public function testItHydrateDataboxWhenInCache()
{
$databox = $this->prophesize(\databox::class);
$this->cache->fetch($this->cacheKey)->willReturn([42 => ['foo' => 'bar']]);
$this->repository->find(42)->shouldNotBeCalled();
$this->factory->create(42, ['foo' => 'bar'])->willReturn($databox->reveal());
$this->assertSame($databox->reveal(), $this->sut->find(42));
}
示例2: testLoad
/**
*/
public function testLoad()
{
$id = 1;
/** @var EntityInterface|ObjectProphecy $entity */
$entity = $this->prophesize('AppBundle\\Entity\\EntityInterface');
$this->repository->find($id)->willReturn($entity->reveal())->shouldBeCalledTimes(1);
$this->assertSame($entity->reveal(), $this->manager->load($id));
}
示例3: findDelegates
/**
* @test
*/
public function findDelegates()
{
$param = 'xoxo';
$expected = 'tus';
$this->repo->find($param)->shouldBeCalled()->willReturn($expected);
$ret = $this->filelib->getFileRepository()->find($param);
$this->assertEquals($expected, $ret);
}