Skip to content

Commit

Permalink
Update mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Nov 13, 2024
1 parent 05e9407 commit 0b7c142
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ class PhishingDetectionIntegrationTests: XCTestCase {
}

class MockFeatureFlagger: FeatureFlagger {
func isFeatureOn<F>(forProvider: F) -> Bool where F: BrowserServicesKit.FeatureFlagSourceProviding {
var internalUserDecider: InternalUserDecider = DefaultInternalUserDecider(store: MockInternalUserStoring())
var localOverrides: FeatureFlagLocalOverriding?

func isFeatureOn<Flag: FeatureFlagProtocol>(for featureFlag: Flag, allowOverride: Bool) -> Bool {
return true
}
}
5 changes: 4 additions & 1 deletion UnitTests/Menus/MainMenuTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ class MainMenuTests: XCTestCase {
}

private class DummyFeatureFlagger: FeatureFlagger {
func isFeatureOn<F: BrowserServicesKit.FeatureFlagSourceProviding>(forProvider: F) -> Bool {
var internalUserDecider: InternalUserDecider = DefaultInternalUserDecider(store: MockInternalUserStoring())
var localOverrides: FeatureFlagLocalOverriding?

func isFeatureOn<Flag: FeatureFlagProtocol>(for: Flag, allowOverride: Bool) -> Bool {
false
}
}
Expand Down
5 changes: 4 additions & 1 deletion UnitTests/TabExtensionsTests/ErrorPageTabExtensionTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,11 @@ class ChallangeSender: URLAuthenticationChallengeSender {
}

class MockFeatureFlagger: FeatureFlagger {
var internalUserDecider: InternalUserDecider = DefaultInternalUserDecider(store: MockInternalUserStoring())
var localOverrides: FeatureFlagLocalOverriding?

var isFeatureOn = true
func isFeatureOn<F>(forProvider: F) -> Bool where F: BrowserServicesKit.FeatureFlagSourceProviding {
func isFeatureOn<Flag: FeatureFlagProtocol>(for featureFlag: Flag, allowOverride: Bool) -> Bool {
return isFeatureOn
}
}

0 comments on commit 0b7c142

Please sign in to comment.