File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed
Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ public protocol AnalyticsProvider {
2222 ///
2323 func track( _ eventName: String , withProperties properties: [ AnyHashable : Any ] ? )
2424
25- /// Clear queued track events
25+ /// Clear queued events
2626 ///
27- func clearTracksEvents ( )
27+ func clearEvents ( )
2828
2929 /// Switch between an authed user and anon user
3030 ///
31- func clearTracksUsers ( )
31+ func clearUsers ( )
3232}
Original file line number Diff line number Diff line change @@ -42,13 +42,13 @@ public extension TracksProvider {
4242 }
4343 }
4444
45- func clearTracksEvents ( ) {
45+ func clearEvents ( ) {
4646 tracksService. clearQueuedEvents ( )
4747 }
4848
4949 /// When a user opts-out, wipe data
5050 ///
51- func clearTracksUsers ( ) {
51+ func clearUsers ( ) {
5252 guard WooAnalytics . shared. userHasOptedIn else {
5353 // To be safe, nil out the anonymousUserID guid so a fresh one is regenerated
5454 UserDefaults . standard [ . defaultAnonymousID] = nil
Original file line number Diff line number Diff line change @@ -131,8 +131,8 @@ extension WooAnalytics {
131131 DDLogInfo ( " 🔵 Tracking started. " )
132132 } else {
133133 stopObservingNotifications ( )
134- analyticsProvider. clearTracksEvents ( )
135- analyticsProvider. clearTracksUsers ( )
134+ analyticsProvider. clearEvents ( )
135+ analyticsProvider. clearUsers ( )
136136 DDLogInfo ( " 🔴 Tracking opt-out complete. " )
137137 }
138138 }
Original file line number Diff line number Diff line change @@ -29,11 +29,11 @@ public extension MockupAnalyticsProvider {
2929 }
3030 }
3131
32- func clearTracksEvents ( ) {
32+ func clearEvents ( ) {
3333 receivedEvents. removeAll ( )
3434 }
3535
36- func clearTracksUsers ( ) {
36+ func clearUsers ( ) {
3737 userOptedIn = false
3838 userID = nil
3939 }
Original file line number Diff line number Diff line change @@ -93,15 +93,15 @@ class WooAnalyticsTests: XCTestCase {
9393 /// Test user opted out
9494 ///
9595 func testUserOptedOut( ) {
96- testingProvider? . clearTracksUsers ( )
96+ testingProvider? . clearUsers ( )
9797 XCTAssertTrue ( testingProvider? . userID == nil )
9898 XCTAssertTrue ( testingProvider? . userOptedIn == false )
9999 }
100100
101101 /// Test clear all events
102102 ///
103103 func testClearAllEvents( ) {
104- testingProvider? . clearTracksEvents ( )
104+ testingProvider? . clearEvents ( )
105105 XCTAssertEqual ( testingProvider? . receivedEvents. count, 0 )
106106 }
107107}
You can’t perform that action at this time.
0 commit comments