File tree Expand file tree Collapse file tree 6 files changed +18
-13
lines changed
Tests/WordPressKitTests/Tests Expand file tree Collapse file tree 6 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ let package = Package(
11
11
targets: [
12
12
. binaryTarget(
13
13
name: " WordPressKit " ,
14
- url: " https://github.com/user-attachments/files/18570063 /WordPressKit.zip " ,
15
- checksum: " fc25d3065e80af713dac970db7ed89ff37e4cc98afc98b6a2ecf7b47b2ddd0c1 "
14
+ url: " https://github.com/user-attachments/files/19034191 /WordPressKit.zip " ,
15
+ checksum: " 34f108cba86b5e4334d1c9af79946dbb8b665e270bdd14bc8f7bc0ba7a898583 "
16
16
) ,
17
17
]
18
18
)
Original file line number Diff line number Diff line change 17
17
@property (nonatomic , strong ) NSNumber *commentCount;
18
18
@property (nonatomic ) BOOL commentsOpen;
19
19
@property (nonatomic , strong ) NSString *featuredImage;
20
+ @property (nonatomic , strong ) NSString *autoSuggestedFeaturedImage;
21
+ @property (nonatomic , strong ) NSString *suitableImageFromPostContent;
20
22
@property (nonatomic , strong ) NSNumber *feedID;
21
23
@property (nonatomic , strong ) NSNumber *feedItemID;
22
24
@property (nonatomic , strong ) NSString *globalID;
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ - (instancetype)initWithDictionary:(NSDictionary *)dict;
109
109
self.content = [self postContentFromPostDictionary: dict];
110
110
self.date_created_gmt = [self stringOrEmptyString: [dict stringForKey: PostRESTKeyDate]];
111
111
self.featuredImage = [self featuredImageFromPostDictionary: dict];
112
+ self.autoSuggestedFeaturedImage = [self sanitizeFeaturedImageString: [self featuredMediaImageFromPostDictionary: dict]];
113
+ self.suitableImageFromPostContent = [self sanitizeFeaturedImageString: [self suitableImageFromPostContent: dict]];
112
114
self.feedID = [dict numberForKey: PostRESTKeyFeedID];
113
115
self.feedItemID = [dict numberForKey: PostRESTKeyFeedItemID];
114
116
self.globalID = [self stringOrEmptyString: [dict stringForKey: PostRESTKeyGlobalID]];
Original file line number Diff line number Diff line change 30
30
*/
31
31
- (void )updateCommentWithID : (NSNumber * _Nonnull)commentID
32
32
content : (NSString * _Nonnull)content
33
- success : (void (^ _Nullable)(void ))success
33
+ success : (void (^ _Nullable)(RemoteComment * _Nullable comment ))success
34
34
failure : (void (^ _Nullable)(NSError * _Nullable error))failure ;
35
35
36
36
/* *
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ - (void)syncHierarchicalCommentsForPost:(NSNumber *)postID
246
246
247
247
- (void )updateCommentWithID : (NSNumber *)commentID
248
248
content : (NSString *)content
249
- success : (void (^)(void ))success
249
+ success : (void (^)(RemoteComment *comment ))success
250
250
failure : (void (^)(NSError *error))failure
251
251
{
252
252
NSString *path = [NSString stringWithFormat: @" sites/%@ /comments/%@ " , self .siteID, commentID];
@@ -260,14 +260,15 @@ - (void)updateCommentWithID:(NSNumber *)commentID
260
260
[self .wordPressComRESTAPI post: requestUrl
261
261
parameters: parameters
262
262
success: ^(id responseObject, NSHTTPURLResponse *httpResponse) {
263
- if (success) {
264
- success ();
265
- }
266
- } failure: ^(NSError *error, NSHTTPURLResponse *httpResponse) {
267
- if (failure) {
268
- failure (error);
269
- }
270
- }];
263
+ RemoteComment *comment = [self remoteCommentFromJSONDictionary: responseObject];
264
+ if (success) {
265
+ success (comment);
266
+ }
267
+ } failure: ^(NSError *error, NSHTTPURLResponse *httpResponse) {
268
+ if (failure) {
269
+ failure (error);
270
+ }
271
+ }];
271
272
}
272
273
273
274
- (void )replyToPostWithID : (NSNumber *)postID
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ - (void)testFeaturedImageFromDictionary {
209
209
uri, uri, uri]
210
210
};
211
211
imagePath = [remoteReaderPost featuredImageFromPostDictionary: dict];
212
- XCTAssertTrue ([uri isEqualToString: imagePath] , @" Failed to retrieve the image uri from the post content. " );
212
+ XCTAssertTrue (imagePath. length == 0 , @" No image should be retrieved from the content" );
213
213
214
214
dict = [self editorialDictionaryWithKey: @" image" value: uri];
215
215
imagePath = [remoteReaderPost featuredImageFromPostDictionary: dict];
You can’t perform that action at this time.
0 commit comments