helperService = new HelperService(); $this->songRepository = new SongRepository($this->helperService); } public function testGetOneByPath(): void { /** @var Song $song */ $song = factory(Song::class)->create(['path' => 'foo']); self::assertSame($song->id, $this->songRepository->getOneByPath('foo')->id); } }