From 622fed183760a8a80877a4d716c0ab68a37d464b Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 10 Mar 2026 14:15:21 -0400 Subject: [PATCH 1/6] fix(package): make tests opt-in via testables - Add "testables": ["extensions.unity.playerprefsex"] to Unity-Tests project manifests (2022.3, 2023.2, 6000.3) so package tests load only in those projects; other dependents do not list testables and do not load package tests by default. - Document in package README that tests are opt-in and that consumers must add the package to the testables array in Packages/manifest.json to run the package tests, with links to Unity testables and package-test docs. - Existing test asmdefs (optionalUnityReferences: TestAssemblies) already support the Test Framework; no asmdef changes required for testables. --- Unity-Package/Assets/root/README.md | 15 +++++++++++++++ ...nsions.Unity.PlayerPrefsEx.Editor.Tests.asmdef | 3 +-- .../Extensions.Unity.PlayerPrefsEx.Tests.asmdef | 8 +++----- Unity-Tests/2022.3.62f3/Packages/manifest.json | 1 + Unity-Tests/2023.2.22f1/Packages/manifest.json | 1 + Unity-Tests/6000.3.1f1/Packages/manifest.json | 1 + 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Unity-Package/Assets/root/README.md b/Unity-Package/Assets/root/README.md index 611583a..099b2e4 100644 --- a/Unity-Package/Assets/root/README.md +++ b/Unity-Package/Assets/root/README.md @@ -79,6 +79,21 @@ When you package is distributed, you can install it into any Unity project. openupm add extensions.unity.playerprefsex ``` +## Running the package tests (opt-in) + +This package includes tests but does not load them in the Unity Test Runner by default. To run the package's tests in your project, add the package to the `testables` array in your project manifest (`Packages/manifest.json`): + +```json +{ + "dependencies": { + "extensions.unity.playerprefsex": "X.X.X" + }, + "testables": ["extensions.unity.playerprefsex"] +} +``` + +See [Unity's documentation on testables](https://docs.unity3d.com/Manual/upm-manifestPrj.html#testables) and [Adding tests to a package](https://docs.unity3d.com/Manual/cus-tests.html). + # Features ✔️ Key is encrypted. Encrypted depends on a device. Much more harder for hackers to hack your data. Saved data at one device won't work on another one if someone copied it from device to device. In the same time for UnityEditor the device identifier is a constant. That means data copied between devices could be opened if you work on multiple machines and want to save/sent/load saved data on different machines. diff --git a/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef b/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef index 5895dcc..ae8f536 100644 --- a/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef +++ b/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef @@ -2,14 +2,13 @@ "name": "Extensions.Unity.PlayerPrefsEx.Editor.Tests", "rootNamespace": "", "references": [ - "UnityEditor.TestRunner", - "UnityEngine.TestRunner", "Extensions.Unity.PlayerPrefsEx" ], "includePlatforms": [ "Editor" ], "excludePlatforms": [], + "optionalUnityReferences": ["TestAssemblies"], "allowUnsafeCode": false, "overrideReferences": false, "precompiledReferences": [], diff --git a/Unity-Package/Assets/root/Tests/Runtime/Extensions.Unity.PlayerPrefsEx.Tests.asmdef b/Unity-Package/Assets/root/Tests/Runtime/Extensions.Unity.PlayerPrefsEx.Tests.asmdef index f69938a..96c78ed 100644 --- a/Unity-Package/Assets/root/Tests/Runtime/Extensions.Unity.PlayerPrefsEx.Tests.asmdef +++ b/Unity-Package/Assets/root/Tests/Runtime/Extensions.Unity.PlayerPrefsEx.Tests.asmdef @@ -2,16 +2,14 @@ "name": "Extensions.Unity.PlayerPrefsEx.Tests", "rootNamespace": "", "references": [ - "UnityEngine.TestRunner", "Extensions.Unity.PlayerPrefsEx" ], "includePlatforms": [], "excludePlatforms": [], + "optionalUnityReferences": ["TestAssemblies"], "allowUnsafeCode": false, - "overrideReferences": true, - "precompiledReferences": [ - "nunit.framework.dll" - ], + "overrideReferences": false, + "precompiledReferences": [], "autoReferenced": true, "defineConstraints": [ "UNITY_INCLUDE_TESTS" diff --git a/Unity-Tests/2022.3.62f3/Packages/manifest.json b/Unity-Tests/2022.3.62f3/Packages/manifest.json index 80e5302..3954840 100644 --- a/Unity-Tests/2022.3.62f3/Packages/manifest.json +++ b/Unity-Tests/2022.3.62f3/Packages/manifest.json @@ -34,6 +34,7 @@ "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" }, + "testables": ["extensions.unity.playerprefsex"], "scopedRegistries": [ { "name": "package.openupm.com", diff --git a/Unity-Tests/2023.2.22f1/Packages/manifest.json b/Unity-Tests/2023.2.22f1/Packages/manifest.json index 8771732..0b55dd2 100644 --- a/Unity-Tests/2023.2.22f1/Packages/manifest.json +++ b/Unity-Tests/2023.2.22f1/Packages/manifest.json @@ -37,6 +37,7 @@ "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" }, + "testables": ["extensions.unity.playerprefsex"], "scopedRegistries": [ { "name": "package.openupm.com", diff --git a/Unity-Tests/6000.3.1f1/Packages/manifest.json b/Unity-Tests/6000.3.1f1/Packages/manifest.json index 0bd5f6b..3eb935b 100644 --- a/Unity-Tests/6000.3.1f1/Packages/manifest.json +++ b/Unity-Tests/6000.3.1f1/Packages/manifest.json @@ -38,6 +38,7 @@ "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" }, + "testables": ["extensions.unity.playerprefsex"], "scopedRegistries": [ { "name": "package.openupm.com", From 8a45eaba13c4d5f89047063b23ec9923244d29eb Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 10 Mar 2026 14:35:10 -0400 Subject: [PATCH 2/6] fix asmdef --- .../Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef b/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef index ae8f536..29ff890 100644 --- a/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef +++ b/Unity-Package/Assets/root/Tests/Editor/Extensions.Unity.PlayerPrefsEx.Editor.Tests.asmdef @@ -13,7 +13,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file From 1b4d2f8d24e5778b89c802fda0de1820b918f4ff Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 10 Mar 2026 14:48:36 -0400 Subject: [PATCH 3/6] bump package version to 2.1.3 --- Unity-Package/Assets/root/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Unity-Package/Assets/root/package.json b/Unity-Package/Assets/root/package.json index 890e18d..2e856f2 100644 --- a/Unity-Package/Assets/root/package.json +++ b/Unity-Package/Assets/root/package.json @@ -5,7 +5,7 @@ "name": "Ivan Murzak", "url": "https://github.com/IvanMurzak" }, - "version": "2.1.2", + "version": "2.1.3", "unity": "2018.3", "description": "Lightweight package with optimized advanced version of PlayerPrefs. Under the hood it uses the same PlayerPrefs system, but creates flexible wrapper for default system.", "keywords": [ @@ -18,4 +18,4 @@ "reactive data" ], "dependencies": {} -} +} \ No newline at end of file From 3ee44d6fa1b7b06373e76543e39eec56f3761605 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 10 Mar 2026 15:07:08 -0400 Subject: [PATCH 4/6] PR feedback --- Unity-Package/Assets/root/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Unity-Package/Assets/root/README.md b/Unity-Package/Assets/root/README.md index 099b2e4..b5cf013 100644 --- a/Unity-Package/Assets/root/README.md +++ b/Unity-Package/Assets/root/README.md @@ -81,14 +81,16 @@ openupm add extensions.unity.playerprefsex ## Running the package tests (opt-in) -This package includes tests but does not load them in the Unity Test Runner by default. To run the package's tests in your project, add the package to the `testables` array in your project manifest (`Packages/manifest.json`): +This package includes tests but does not load them in the Unity Test Runner by default. To run the package's tests in your project, add the package name to the existing `testables` array in your project manifest (`Packages/manifest.json`). For example, your manifest might include: ```json { "dependencies": { - "extensions.unity.playerprefsex": "X.X.X" - }, - "testables": ["extensions.unity.playerprefsex"] + "extensions.unity.playerprefsex": "X.X.X" + }, + "testables": [ + "extensions.unity.playerprefsex" + ] } ``` From d85f5846d7f623f0914cdf630364d2de9f875f11 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 10 Mar 2026 19:04:51 -0400 Subject: [PATCH 5/6] add second docs link --- Unity-Package/Assets/root/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity-Package/Assets/root/README.md b/Unity-Package/Assets/root/README.md index b5cf013..39bb02c 100644 --- a/Unity-Package/Assets/root/README.md +++ b/Unity-Package/Assets/root/README.md @@ -94,7 +94,7 @@ This package includes tests but does not load them in the Unity Test Runner by d } ``` -See [Unity's documentation on testables](https://docs.unity3d.com/Manual/upm-manifestPrj.html#testables) and [Adding tests to a package](https://docs.unity3d.com/Manual/cus-tests.html). +See [Unity's documentation on testables](https://docs.unity3d.com/Manual/upm-manifestPrj.html#testables) and [Add tests to your package](https://docs.unity3d.com/Manual/cus-tests.html). # Features From 5a9b2bf9c1f9035e1eb651fa81a4661358156f8e Mon Sep 17 00:00:00 2001 From: Ivan Murzak Date: Wed, 11 Mar 2026 02:05:19 -0700 Subject: [PATCH 6/6] bump package version to 2.1.3 --- Installer/Assets/PlayerPrefsEx Installer/Installer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installer/Assets/PlayerPrefsEx Installer/Installer.cs b/Installer/Assets/PlayerPrefsEx Installer/Installer.cs index 0619bb3..2001b5f 100644 --- a/Installer/Assets/PlayerPrefsEx Installer/Installer.cs +++ b/Installer/Assets/PlayerPrefsEx Installer/Installer.cs @@ -16,7 +16,7 @@ namespace Extensions.Unity.PlayerPrefsEx.Installer public static partial class Installer { public const string PackageId = "extensions.unity.playerprefsex"; - public const string Version = "2.1.2"; + public const string Version = "2.1.3"; static Installer() {