Browse Source

Fix references to MissingControllerException

Mark Story 6 years ago
parent
commit
c8b55013c8

+ 3 - 3
tests/TestCase/Error/ErrorHandlerTest.php

@@ -21,9 +21,9 @@ use Cake\Datasource\Exception\RecordNotFoundException;
 use Cake\Error\ErrorHandler;
 use Cake\Http\Exception\ForbiddenException;
 use Cake\Http\Exception\NotFoundException;
+use Cake\Http\Exception\MissingControllerException;
 use Cake\Http\ServerRequest;
 use Cake\Log\Log;
-use Cake\Routing\Exception\MissingControllerException;
 use Cake\Routing\Router;
 use Cake\TestSuite\TestCase;
 use Psr\Log\LoggerInterface;
@@ -308,7 +308,7 @@ class ErrorHandlerTest extends TestCase
             ->method('log')
             ->with('error', $this->logicalAnd(
                 $this->stringContains(
-                    '[Cake\Routing\Exception\MissingControllerException] ' .
+                    '[Cake\Http\Exception\MissingControllerException] ' .
                     'Controller class Derp could not be found.'
                 ),
                 $this->stringContains('Exception Attributes:'),
@@ -320,7 +320,7 @@ class ErrorHandlerTest extends TestCase
             ->method('log')
             ->with('error', $this->logicalAnd(
                 $this->stringContains(
-                    '[Cake\Routing\Exception\MissingControllerException] ' .
+                    '[Cake\Http\Exception\MissingControllerException] ' .
                     'Controller class Derp could not be found.'
                 ),
                 $this->logicalNot($this->stringContains('Exception Attributes:'))

+ 1 - 1
tests/TestCase/Error/ExceptionRendererTest.php

@@ -30,11 +30,11 @@ use Cake\Event\EventManager;
 use Cake\Http\Exception\HttpException;
 use Cake\Http\Exception\InternalErrorException;
 use Cake\Http\Exception\MethodNotAllowedException;
+use Cake\Http\Exception\MissingControllerException;
 use Cake\Http\Exception\NotFoundException;
 use Cake\Http\ServerRequest;
 use Cake\Mailer\Exception\MissingActionException as MissingMailerActionException;
 use Cake\ORM\Exception\MissingBehaviorException;
-use Cake\Routing\Exception\MissingControllerException;
 use Cake\Routing\Router;
 use Cake\TestSuite\TestCase;
 use Cake\View\Exception\MissingHelperException;

+ 3 - 2
tests/TestCase/Error/Middleware/ErrorHandlerMiddlewareTest.php

@@ -19,6 +19,7 @@ namespace Cake\Test\TestCase\Error\Middleware;
 use Cake\Error\ErrorHandler;
 use Cake\Error\ExceptionRendererInterface;
 use Cake\Error\Middleware\ErrorHandlerMiddleware;
+use Cake\Http\Exception\MissingControllerException;
 use Cake\Http\Response;
 use Cake\Http\ServerRequestFactory;
 use Cake\Log\Log;
@@ -260,7 +261,7 @@ class ErrorHandlerMiddlewareTest extends TestCase
             ->method('log')
             ->with('error', $this->logicalAnd(
                 $this->stringContains(
-                    '[Cake\Routing\Exception\MissingControllerException] ' .
+                    '[Cake\Http\Exception\MissingControllerException] ' .
                     'Controller class Articles could not be found.'
                 ),
                 $this->stringContains('Exception Attributes:'),
@@ -271,7 +272,7 @@ class ErrorHandlerMiddlewareTest extends TestCase
         $request = ServerRequestFactory::fromGlobals();
         $middleware = new ErrorHandlerMiddleware(null, ['log' => true]);
         $handler = new TestRequestHandler(function ($req) {
-            throw new \Cake\Routing\Exception\MissingControllerException(['class' => 'Articles']);
+            throw new MissingControllerException(['class' => 'Articles']);
         });
         $result = $middleware->process($request, $handler);
         $this->assertEquals(404, $result->getStatusCode());

+ 1 - 1
tests/TestCase/ExceptionsTest.php

@@ -182,6 +182,7 @@ class ExceptionsTest extends TestCase
             ['Cake\Http\Exception\InternalErrorException', 500],
             ['Cake\Http\Exception\InvalidCsrfTokenException', 403],
             ['Cake\Http\Exception\MethodNotAllowedException', 405],
+            ['Cake\Http\Exception\MissingControllerException', 500],
             ['Cake\Http\Exception\NotAcceptableException', 406],
             ['Cake\Http\Exception\NotFoundException', 404],
             ['Cake\Http\Exception\NotImplementedException', 501],
@@ -194,7 +195,6 @@ class ExceptionsTest extends TestCase
             ['Cake\ORM\Exception\MissingTableClassException', 500],
             ['Cake\ORM\Exception\RolledbackTransactionException', 500],
             ['Cake\Routing\Exception\DuplicateNamedRouteException', 500],
-            ['Cake\Routing\Exception\MissingControllerException', 500],
             ['Cake\Routing\Exception\MissingDispatcherFilterException', 500],
             ['Cake\Routing\Exception\MissingRouteException', 500],
             ['Cake\Routing\Exception\RedirectException', 302],