@@ -64,6 +64,14 @@ protected function _invoke(Controller $controller, CakeRequest $request, CakeRes
64
64
class MyPluginAppController extends AppController {
65
65
}
66
66
67
+ abstract class DispatcherTestAbstractController extends Controller {
68
+ abstract public function index ();
69
+ }
70
+
71
+ interface DispatcherTestInterfaceController {
72
+ public function index ();
73
+ }
74
+
67
75
/**
68
76
* MyPluginController class
69
77
*
@@ -680,6 +688,41 @@ public function testMissingController() {
680
688
$ controller = $ Dispatcher ->dispatch ($ url , $ response , array ('return ' => 1 ));
681
689
}
682
690
691
+ /**
692
+ * testMissingControllerInterface method
693
+ *
694
+ * @expectedException MissingControllerException
695
+ * @expectedExceptionMessage Controller class DispatcherTestInterfaceController could not be found.
696
+ * @return void
697
+ */
698
+ public function testMissingControllerInterface () {
699
+ Router::connect ('/:controller/:action/* ' );
700
+
701
+ $ Dispatcher = new TestDispatcher ();
702
+ Configure::write ('App.baseUrl ' , '/index.php ' );
703
+ $ url = new CakeRequest ('dispatcher_test_interface/index ' );
704
+ $ response = $ this ->getMock ('CakeResponse ' );
705
+
706
+ $ controller = $ Dispatcher ->dispatch ($ url , $ response , array ('return ' => 1 ));
707
+ }
708
+
709
+ /**
710
+ * testMissingControllerInterface method
711
+ *
712
+ * @expectedException MissingControllerException
713
+ * @expectedExceptionMessage Controller class DispatcherTestAbstractController could not be found.
714
+ * @return void
715
+ */
716
+ public function testMissingControllerAbstract () {
717
+ Router::connect ('/:controller/:action/* ' );
718
+
719
+ $ Dispatcher = new TestDispatcher ();
720
+ Configure::write ('App.baseUrl ' , '/index.php ' );
721
+ $ url = new CakeRequest ('dispatcher_test_abstract/index ' );
722
+ $ response = $ this ->getMock ('CakeResponse ' );
723
+
724
+ $ controller = $ Dispatcher ->dispatch ($ url , $ response , array ('return ' => 1 ));
725
+ }
683
726
/**
684
727
* testDispatch method
685
728
*
0 commit comments