4

I am trying to unit test retrieving assetCollection and assets. In order to be allowed to access my PhotoAlbums I have to grant permissions. This normally either happens during the first call of a function like fetchAssetCollections or manually by calling PHPhotoLibrary.requestAuthorization().

Now the question is how can I assume I have permissions when running my unit tests? Because as soon as I call PHAssetCollection.fetchAssetCollections(withLocalIdentifiers: [ album ], options: nil) I get a PHUnauthorizedFetchResult.

3vangelos
  • 501
  • 8
  • 15
  • Did you figure this out? I just move the processing logic to a separate function and just test that. – B K Aug 14 '18 at 18:48

0 Answers0