public function testItFindsAllDeclaredDataboxesFromCache() { $databox = $this->prophesize(\databox::class); $cache_data = [42 => ['foo' => 'bar']]; $databoxes = [42 => $databox->reveal()]; $this->cache->fetch($this->cacheKey)->willReturn($cache_data); $this->repository->findAll()->shouldNotBeCalled(); $this->factory->createMany($cache_data)->willReturn($databoxes); $this->assertSame($databoxes, $this->sut->findAll()); }
/** * @test */ public function findAllDelegates() { $expected = 'tus'; $this->repo->findAll()->shouldBeCalled()->willReturn($expected); $ret = $this->filelib->getFileRepository()->findAll(); $this->assertEquals($expected, $ret); }