|
|
@@ -21,6 +21,7 @@ use Cake\Controller\Exception\MissingActionException;
|
|
|
use Cake\Core\Configure;
|
|
|
use Cake\Event\Event;
|
|
|
use Cake\Event\EventInterface;
|
|
|
+use Cake\Http\Exception\NotFoundException;
|
|
|
use Cake\Http\Response;
|
|
|
use Cake\Http\ServerRequest;
|
|
|
use Cake\Routing\Router;
|
|
|
@@ -396,6 +397,20 @@ class ControllerTest extends TestCase
|
|
|
$this->assertTextStartsWith('<?xml', $response->getBody() . '', 'Body should be xml');
|
|
|
}
|
|
|
|
|
|
+ public function testRenderViewClassesMineExtMissingView()
|
|
|
+ {
|
|
|
+ $request = new ServerRequest([
|
|
|
+ 'url' => '/',
|
|
|
+ 'environment' => [],
|
|
|
+ 'params' => ['plugin' => null, 'controller' => 'ContentTypes', 'action' => 'all', '_ext' => 'json'],
|
|
|
+ ]);
|
|
|
+ $controller = new ContentTypesController($request, new Response());
|
|
|
+ $controller->plain();
|
|
|
+
|
|
|
+ $this->expectException(NotFoundException::class);
|
|
|
+ $response = $controller->render();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* test view rendering changing response
|
|
|
*/
|