/** * @dataProvider provideGetByIds */ public function testGetByIds($ids, $media, $result) { $this->mediaRepository->findMedia(Argument::any())->willReturn($media); $this->formatManager->getFormats(Argument::cetera())->willReturn(null); $medias = $this->mediaManager->getByIds($ids, 'en'); for ($i = 0; $i < count($medias); ++$i) { $this->assertEquals($result[$i]->getId(), $medias[$i]->getId()); } }
public function testGetWithoutToken() { $this->tokenStorage->getToken()->willReturn(null); $this->mediaRepository->findMedia(Argument::cetera())->willReturn([])->shouldBeCalled(); $this->mediaRepository->count(Argument::cetera())->shouldBeCalled(); $this->mediaManager->get(1); }