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)); }
/** */ 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)); }
/** * @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); }