Skip to content

Commit 0a8e2aa

Browse files
authored
Merge branch 'develop' into drop-in-tests
2 parents f1f0d0d + ed9c64f commit 0a8e2aa

File tree

9 files changed

+34
-77
lines changed

9 files changed

+34
-77
lines changed

Adyen.xcodeproj/project.pbxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@
150150
81825CB92AC59C3300F91912 /* UIView+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CB72AC59C3300F91912 /* UIView+Search.swift */; };
151151
81825CBB2AC59C4000F91912 /* UIViewController+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CBA2AC59C4000F91912 /* UIViewController+Search.swift */; };
152152
81825CBC2AC59C4000F91912 /* UIViewController+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CBA2AC59C4000F91912 /* UIViewController+Search.swift */; };
153-
81825CBE2AC59C4B00F91912 /* XCTestCase+Available.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CBD2AC59C4B00F91912 /* XCTestCase+Available.swift */; };
154-
81825CBF2AC59C4B00F91912 /* XCTestCase+Available.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CBD2AC59C4B00F91912 /* XCTestCase+Available.swift */; };
155153
81825CC12AC59C6400F91912 /* XCTestCase+RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CC02AC59C6400F91912 /* XCTestCase+RootViewController.swift */; };
156154
81825CC22AC59C6400F91912 /* XCTestCase+RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CC02AC59C6400F91912 /* XCTestCase+RootViewController.swift */; };
157155
81825CC42AC59C6C00F91912 /* XCTestCase+Wait.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81825CC32AC59C6C00F91912 /* XCTestCase+Wait.swift */; };
@@ -1367,7 +1365,6 @@
13671365
814276612A7145F50081E896 /* AddressInputFormViewController+ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AddressInputFormViewController+ViewModel.swift"; sourceTree = "<group>"; };
13681366
81825CB72AC59C3300F91912 /* UIView+Search.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Search.swift"; sourceTree = "<group>"; };
13691367
81825CBA2AC59C4000F91912 /* UIViewController+Search.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+Search.swift"; sourceTree = "<group>"; };
1370-
81825CBD2AC59C4B00F91912 /* XCTestCase+Available.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+Available.swift"; sourceTree = "<group>"; };
13711368
81825CC02AC59C6400F91912 /* XCTestCase+RootViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+RootViewController.swift"; sourceTree = "<group>"; };
13721369
81825CC32AC59C6C00F91912 /* XCTestCase+Wait.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+Wait.swift"; sourceTree = "<group>"; };
13731370
81896E842A4DB5F300C532CA /* SearchViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewControllerTests.swift; sourceTree = "<group>"; };
@@ -2907,7 +2904,6 @@
29072904
children = (
29082905
81825CB72AC59C3300F91912 /* UIView+Search.swift */,
29092906
81825CBA2AC59C4000F91912 /* UIViewController+Search.swift */,
2910-
81825CBD2AC59C4B00F91912 /* XCTestCase+Available.swift */,
29112907
81825CC32AC59C6C00F91912 /* XCTestCase+Wait.swift */,
29122908
F96AE51A26038602009F82BD /* XCTestCaseExtension.swift */,
29132909
81825CC02AC59C6400F91912 /* XCTestCase+RootViewController.swift */,
@@ -6730,7 +6726,6 @@
67306726
F924C072246BEEF0006DDAB8 /* CardDetailsTests.swift in Sources */,
67316727
F9FE39E32679E09200F02A9B /* LoadingViewTests.swift in Sources */,
67326728
F96A25472372C39F007DBF0B /* ApplePayDetailsTest.swift in Sources */,
6733-
81825CBE2AC59C4B00F91912 /* XCTestCase+Available.swift in Sources */,
67346729
A07B2CF226A5D4FE0008185C /* BrazilSocialSecurityNumberFormatterTests.swift in Sources */,
67356730
A04E60DB27F30D900051C72C /* SessionDelegateMock.swift in Sources */,
67366731
F9AC61C424375F510062A00D /* PresentingViewControllerMock.swift in Sources */,
@@ -7227,7 +7222,6 @@
72277222
00220955299B8B1C00B2BACD /* BLIKComponentUITests.swift in Sources */,
72287223
81825CC22AC59C6400F91912 /* XCTestCase+RootViewController.swift in Sources */,
72297224
F9CCA3D7296ECDB200AD643D /* XCTestCase+Coder.swift in Sources */,
7230-
81825CBF2AC59C4B00F91912 /* XCTestCase+Available.swift in Sources */,
72317225
F9CCA3C5296ECB9900AD643D /* ListViewControllerUITests.swift in Sources */,
72327226
F9CCA3D3296ECD0700AD643D /* PostalAddressMocks.swift in Sources */,
72337227
);

Adyen/UI/View Controllers/SecuredViewController.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,10 @@ public final class SecuredViewController<ChildViewController: UIViewController>:
8282
private var blurEffectView: UIVisualEffectView
8383

8484
private lazy var blurEffect: UIBlurEffect = {
85-
if #available(iOS 12.0, *) {
86-
switch traitCollection.userInterfaceStyle {
87-
case .dark:
88-
return UIBlurEffect(style: .dark)
89-
case .light, .unspecified:
90-
return UIBlurEffect(style: .light)
91-
@unknown default:
92-
return UIBlurEffect(style: .light)
93-
}
94-
} else {
85+
switch traitCollection.userInterfaceStyle {
86+
case .dark:
87+
return UIBlurEffect(style: .dark)
88+
default:
9589
return UIBlurEffect(style: .light)
9690
}
9791
}()

AdyenComponents/Apple Pay/ApplePayConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ extension PKPaymentNetwork {
177177

178178
internal var txVariantName: String {
179179
if self == .masterCard { return "mc" }
180-
if #available(iOS 11.2, *), self == .cartesBancaires { return "cartebancaire" }
180+
if self == .cartesBancaires { return "cartebancaire" }
181181
return self.rawValue.lowercased()
182182
}
183183

AdyenDropIn/Views/PreApplePayView.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@ internal final class PreApplePayView: UIView, Localizable {
2626

2727
/// Creates PKPaymentButtonStyle based on Dark or Light Mode.
2828
private var paymentButtonStyleAuto: PKPaymentButtonStyle {
29-
let buttonStyle: PKPaymentButtonStyle
3029
if #available(iOS 14.0, *) {
31-
buttonStyle = .automatic
32-
} else if #available(iOS 12.0, *), traitCollection.userInterfaceStyle == .dark {
33-
buttonStyle = .white
34-
} else {
35-
buttonStyle = .black
30+
return .automatic
31+
}
32+
33+
switch traitCollection.userInterfaceStyle {
34+
case .dark:
35+
return .white
36+
default:
37+
return .black
3638
}
37-
return buttonStyle
3839
}
3940

4041
internal init(model: Model) {
@@ -66,9 +67,7 @@ internal final class PreApplePayView: UIView, Localizable {
6667
])
6768
payButton.accessibilityIdentifier = ViewIdentifierBuilder.build(scopeInstance: self, postfix: "applePayButton")
6869

69-
if #available(iOS 12.0, *) {
70-
payButton.cornerRadius = model.style.cornerRadius
71-
}
70+
payButton.cornerRadius = model.style.cornerRadius
7271
}
7372

7473
private func addHintLabel() {

Demo/UIKit/ComponentsView.swift

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,18 @@ internal final class ComponentsView: UIView {
127127
}
128128

129129
private func setUpApplePayCell(_ cell: UITableViewCell) {
130-
let style: PKPaymentButtonStyle
131-
if #available(iOS 14.0, *) {
132-
style = .automatic
133-
} else if #available(iOS 12.0, *), traitCollection.userInterfaceStyle == .dark {
134-
style = .white
135-
} else {
136-
style = .black
137-
}
130+
let style: PKPaymentButtonStyle = {
131+
if #available(iOS 14.0, *) {
132+
return .automatic
133+
}
134+
135+
switch traitCollection.userInterfaceStyle {
136+
case .dark:
137+
return .white
138+
default:
139+
return .black
140+
}
141+
}()
138142

139143
let contentView = cell.contentView
140144

Tests/Adyen Tests/Utilities/AmountFormatterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class AmountFormatterTests: XCTestCase {
7676
XCTAssertEqual(AmountFormatter.formatted(amount: amount, currencyCode: "CVE", localeIdentifier: "ko_KR"), "CVE 123,456")
7777
XCTAssertEqual(AmountFormatter.formatted(amount: amount, currencyCode: "CVE", localeIdentifier: "fr_FR"), "123 456 CVE")
7878

79-
if Available.iOS17 {
79+
if #available(iOS 17.0, *) {
8080
XCTAssertEqual(AmountFormatter.formatted(amount: amount, currencyCode: "ISK", localeIdentifier: "is_IS"), "1.234,56 kr.")
8181
} else {
8282
XCTAssertEqual(AmountFormatter.formatted(amount: amount, currencyCode: "ISK", localeIdentifier: "is_IS"), "1.234,56 ISK")

Tests/Card Tests/3DS2 Component/ThreeDS2PlusDACoreActionHandlerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import XCTest
4141

4242
override func setUpWithError() throws {
4343
guard #available(iOS 14.0, *) else {
44-
// XCTestCase does not respect @available so we have skip all tests here
44+
// XCTestCase does not respect @available so we have to skip the test like this
4545
throw XCTSkip("Unsupported iOS version")
4646
}
4747

Tests/Components Tests/Apple Pay/ApplePayComponentTests.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,11 @@ class ApplePayComponentTest: XCTestCase {
154154
waitForExpectations(timeout: 4)
155155
}
156156

157-
@available(iOS 15.0, *)
158-
func testApplePayCoupon() {
159-
guard Available.iOS15 else { return }
157+
func testApplePayCoupon() throws {
158+
guard #available(iOS 15.0, *) else {
159+
// XCTestCase does not respect @available so we have to skip the test like this
160+
throw XCTSkip("Unsupported iOS version")
161+
}
160162

161163
sut.applePayDelegate = mockApplePayDelegate
162164
(mockApplePayDelegate as! ApplePayDelegateMockiOS15).onCouponChange = { coupon, payment in
@@ -298,7 +300,7 @@ class ApplePayComponentTest: XCTestCase {
298300

299301
func testNewInitSuccess() throws {
300302
guard #available(iOS 16.0, *) else {
301-
// XCTestCase does not respect @available so we have skip all tests here
303+
// XCTestCase does not respect @available so we have to skip the test like this
302304
throw XCTSkip("Unsupported iOS version")
303305
}
304306

Tests/Helpers/XCTestCase+Available.swift

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)