Merge "Add test preparer for phony module types" into main am: 8399758b97 am: 6dcbb6061c

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3013013

Change-Id: I29d1671c4b1e97d19c4bef7f68b0d0e5c3e7d6cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/phony/phony.go b/phony/phony.go
index b8dbd00..68fbf48 100644
--- a/phony/phony.go
+++ b/phony/phony.go
@@ -23,10 +23,16 @@
 )
 
 func init() {
-	android.RegisterModuleType("phony", PhonyFactory)
-	android.RegisterModuleType("phony_rule", PhonyRuleFactory)
+	registerPhonyModuleTypes(android.InitRegistrationContext)
 }
 
+func registerPhonyModuleTypes(ctx android.RegistrationContext) {
+	ctx.RegisterModuleType("phony", PhonyFactory)
+	ctx.RegisterModuleType("phony_rule", PhonyRuleFactory)
+}
+
+var PrepareForTestWithPhony = android.FixtureRegisterWithContext(registerPhonyModuleTypes)
+
 type phony struct {
 	android.ModuleBase
 	requiredModuleNames       []string