Просмотр исходного кода

Merge pull request #2450 from dreampiggy/fix_testcase

Fix the test case testFLAnimatedImageViewSetImageWithURL because of remote resource is not available
Bogdan Poplauschi 7 лет назад
Родитель
Сommit
07d3d1eb6e
3 измененных файлов с 5 добавлено и 1 удалено
  1. 1 1
      Tests/Tests/SDCategoriesTests.m
  2. 2 0
      Tests/Tests/SDTestCase.h
  3. 2 0
      Tests/Tests/SDTestCase.m

+ 1 - 1
Tests/Tests/SDCategoriesTests.m

@@ -126,7 +126,7 @@ static void * SDCategoriesTestsContext = &SDCategoriesTestsContext;
     XCTestExpectation *expectation = [self expectationWithDescription:@"FLAnimatedImageView setImageWithURL"];
     
     FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];
-    NSURL *originalImageURL = [NSURL URLWithString:@"https://www.interntheory.com/img/loading-small.gif"];
+    NSURL *originalImageURL = [NSURL URLWithString:kTestGIFURL];
     
     [imageView sd_setImageWithURL:originalImageURL
                         completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {

+ 2 - 0
Tests/Tests/SDTestCase.h

@@ -17,6 +17,8 @@ FOUNDATION_EXPORT const int64_t kAsyncTestTimeout;
 FOUNDATION_EXPORT const int64_t kMinDelayNanosecond;
 FOUNDATION_EXPORT NSString * _Nonnull const kTestJpegURL;
 FOUNDATION_EXPORT NSString * _Nonnull const kTestPNGURL;
+FOUNDATION_EXPORT NSString * _Nonnull const kTestGIFURL;
+FOUNDATION_EXPORT NSString * _Nonnull const kTestWebPURL;
 
 @interface SDTestCase : XCTestCase
 

+ 2 - 0
Tests/Tests/SDTestCase.m

@@ -13,6 +13,8 @@ const int64_t kAsyncTestTimeout = 5;
 const int64_t kMinDelayNanosecond = NSEC_PER_MSEC * 100; // 0.1s
 NSString *const kTestJpegURL = @"http://via.placeholder.com/50x50.jpg";
 NSString *const kTestPNGURL = @"http://via.placeholder.com/50x50.png";
+NSString *const kTestGIFURL = @"https://media.giphy.com/media/UEsrLdv7ugRTq/giphy.gif";
+NSString *const kTestWebPURL = @"http://littlesvr.ca/apng/images/SteamEngine.webp";
 
 @implementation SDTestCase