auth = Mockery::mock(Guard::class); $this->helperService = new HelperService(); $this->songRepository = new SongRepository($this->auth, $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); } }