backcompat for NEXT in &COMPONENT + test
[catagits/Catalyst-Runtime.git] / t / unit_core_component_mro.t
diff --git a/t/unit_core_component_mro.t b/t/unit_core_component_mro.t
new file mode 100644 (file)
index 0000000..7818402
--- /dev/null
@@ -0,0 +1,26 @@
+use Test::More tests => 2;
+use strict;
+use warnings;
+
+{
+  package MyApp::Component;
+  use Test::More;
+
+  sub COMPONENT{
+    my $caller = caller;
+    is($caller, 'Catalyst::Component', 'Correct method resolution');
+  }
+
+  package MyApp::MyComponent;
+
+  use base 'Catalyst::Component', 'MyApp::Component';
+
+}
+
+{
+  my $expects = qr/after Catalyst::Component in MyApp::Component/;
+  local $SIG{__WARN__} = sub {
+    like($_[0], $expects, 'correct warning thrown');
+  };
+  MyApp::MyComponent->COMPONENT('MyApp');
+}