Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 02a1230

Browse files
committed
Use a more strict check
1 parent 6361cf2 commit 02a1230

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WordPressKitTests/Utilities/HTTPRequestBuilderTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,14 @@ class HTTPRequestBuilderTests: XCTestCase {
407407
let file = try XCTUnwrap(Bundle(for: type(of: self)).url(forResource: "me-settings-success", withExtension: "json"))
408408
let fileContentBase64 = try Data(contentsOf: file).base64EncodedString()
409409
let fileStream = try XCTUnwrap(InputStream(url: file))
410-
411410
let request = try HTTPRequestBuilder(url: URL(string: "https://w.org/xmlrpc.php")!)
412411
.method(.post)
413412
.body(xmlrpc: "wp.uploadFile", parameters: ["username", "passowrd", fileStream])
414413
.build(encodeBody: true)
415-
XCTAssertTrue(request.httpBodyText?.contains(fileContentBase64) == true)
414+
415+
let xmlrpcContent = try XCTUnwrap(request.httpBodyText)
416+
let filePart = "<base64>" + fileContentBase64 + "</base64>"
417+
XCTAssertTrue(xmlrpcContent.contains(filePart))
416418
}
417419

418420
}

0 commit comments

Comments
 (0)