From d65398f33011c88277b77ca28b6b1872e0fe829f Mon Sep 17 00:00:00 2001 From: Kyle Hammond Date: Thu, 27 Jan 2022 11:34:42 -0600 Subject: [PATCH] Fixed Swiftlint build phase on M1 with new Homebrew installation. Added a test for PPPCServices loading. #105 --- PPPC Utility.xcodeproj/project.pbxproj | 2 +- .../ModelTests/PPPCServicesManagerTests.swift | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PPPC Utility.xcodeproj/project.pbxproj b/PPPC Utility.xcodeproj/project.pbxproj index 30eaa24..e0ff089 100644 --- a/PPPC Utility.xcodeproj/project.pbxproj +++ b/PPPC Utility.xcodeproj/project.pbxproj @@ -414,7 +414,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\n\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/PPPC UtilityTests/ModelTests/PPPCServicesManagerTests.swift b/PPPC UtilityTests/ModelTests/PPPCServicesManagerTests.swift index a113a79..6a500ac 100644 --- a/PPPC UtilityTests/ModelTests/PPPCServicesManagerTests.swift +++ b/PPPC UtilityTests/ModelTests/PPPCServicesManagerTests.swift @@ -64,6 +64,18 @@ class PPPCServicesManagerTests: XCTestCase { XCTAssertEqual(actual, "Allows specified apps access to files on removable volumes.\n\nMDM Key: SystemPolicyRemovableVolumes") } + func testCameraIsDenyOnly() throws { + // given + let services = PPPCServicesManager() + let service = try XCTUnwrap(services.allServices["Camera"]) + + // when + let actual = try XCTUnwrap(service.denyOnly) + + // then + XCTAssertTrue(actual) + } + func testScreenCaptureAllowsStandardUsers() throws { // given let services = PPPCServicesManager()