diff --git a/core/src/wheels/Plugins.cfc b/core/src/wheels/Plugins.cfc index 7b810a3d6c..7b73ca6c24 100644 --- a/core/src/wheels/Plugins.cfc +++ b/core/src/wheels/Plugins.cfc @@ -293,6 +293,8 @@ component output="false" extends="wheels.Global"{ $wheels.className = "controller"; } else if (findNoCase("models", $wheels.metaData.fullname)){ $wheels.className = "model"; + } else if (findNoCase("tests", $wheels.metaData.fullname)){ + $wheels.className = "test"; } else { $wheels.className = Reverse(SpanExcluding(Reverse($wheels.metaData.name), ".")); } diff --git a/core/src/wheels/Test.cfc b/core/src/wheels/Test.cfc index 440ad44574..c88ade44ac 100644 --- a/core/src/wheels/Test.cfc +++ b/core/src/wheels/Test.cfc @@ -507,7 +507,7 @@ component output="false" displayName="Test" extends="wheels.Global"{ local.i = 0; for (local.row in local.packages) { local.i++; - local.instance = CreateObject("component", local.row.package); + local.instance = application.wirebox.getInstance(name = "#local.row.package#"); // is there a better way to check for existence of a function? // if the beforeall method is present, run it once only per request if (StructKeyExists(local.instance, "beforeAll") && local.i eq 1) {