Browse Source

Update exception name.

ADmad 11 years ago
parent
commit
4fb7da8786

+ 2 - 2
src/Error/ExceptionRenderer.php

@@ -25,7 +25,7 @@ use Cake\Network\Request;
 use Cake\Network\Response;
 use Cake\Routing\Router;
 use Cake\Utility\Inflector;
-use Cake\View\Exception\MissingViewException;
+use Cake\View\Exception\MissingTemplateException;
 use Exception;
 
 /**
@@ -270,7 +270,7 @@ class ExceptionRenderer {
 			$event = new Event('Controller.shutdown', $this->controller);
 			$this->controller->afterFilter($event);
 			return $this->controller->response;
-		} catch (MissingViewException $e) {
+		} catch (MissingTemplateException $e) {
 			$attributes = $e->getAttributes();
 			if (isset($attributes['file']) && strpos($attributes['file'], 'error500') !== false) {
 				return $this->_outputMessageSafe('error500');

+ 3 - 3
src/View/Cell.php

@@ -21,7 +21,7 @@ use Cake\Network\Request;
 use Cake\Network\Response;
 use Cake\Utility\Inflector;
 use Cake\View\Exception\MissingCellViewException;
-use Cake\View\Exception\MissingViewException;
+use Cake\View\Exception\MissingTemplateException;
 use Cake\View\ViewVarsTrait;
 
 /**
@@ -143,7 +143,7 @@ abstract class Cell {
  * @param string $template Custom template name to render. If not provided (null), the last
  * value will be used. This value is automatically set by `CellTrait::cell()`.
  * @return void
- * @throws \Cake\View\Exception\MissingCellViewException When a MissingViewException is raised during rendering.
+ * @throws \Cake\View\Exception\MissingCellViewException When a MissingTemplateException is raised during rendering.
  */
 	public function render($template = null) {
 		if ($template !== null && strpos($template, '/') === false) {
@@ -164,7 +164,7 @@ abstract class Cell {
 
 		try {
 			return $this->View->render($template);
-		} catch (MissingViewException $e) {
+		} catch (MissingTemplateException $e) {
 			throw new MissingCellViewException(['file' => $template, 'name' => $name]);
 		}
 	}

+ 2 - 2
tests/TestCase/Controller/PagesControllerTest.php

@@ -21,7 +21,7 @@ use Cake\Core\Configure;
 use Cake\Network\Request;
 use Cake\Network\Response;
 use Cake\TestSuite\TestCase;
-use Cake\View\Exception\MissingViewException;
+use Cake\View\Exception\MissingTemplateException;
 use TestApp\Controller\PagesController;
 
 /**
@@ -60,7 +60,7 @@ class PagesControllerTest extends TestCase {
 /**
  * Test that missing view in debug mode renders missing_view error page
  *
- * @expectedException \Cake\View\Exception\MissingViewException
+ * @expectedException \Cake\View\Exception\MissingTemplateException
  * @expectedExceptionCode 500
  * @return void
  */

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

@@ -38,7 +38,7 @@ use Cake\Routing\Router;
 use Cake\TestSuite\TestCase;
 use Cake\View\Exception\MissingHelperException;
 use Cake\View\Exception\MissingLayoutException;
-use Cake\View\Exception\MissingViewException;
+use Cake\View\Exception\MissingTemplateException;
 
 /**
  * BlueberryComponent class
@@ -489,7 +489,7 @@ class ExceptionRendererTest extends TestCase {
 				404
 			),
 			array(
-				new MissingViewException(array('file' => '/posts/about.ctp')),
+				new MissingTemplateException(array('file' => '/posts/about.ctp')),
 				array(
 					"/posts\/about.ctp/"
 				),

+ 2 - 2
tests/TestCase/Network/Email/EmailTest.php

@@ -22,7 +22,7 @@ use Cake\Log\Log;
 use Cake\Network\Email\DebugTransport;
 use Cake\Network\Email\Email;
 use Cake\TestSuite\TestCase;
-use Cake\View\Exception\MissingViewException;
+use Cake\View\Exception\MissingTemplateException;
 
 /**
  * Help to test Email
@@ -1644,7 +1644,7 @@ class EmailTest extends TestCase {
 		$this->assertContains('Here is your value: 12345', $result['message']);
 		$this->assertContains('This email was sent using the TestPlugin.', $result['message']);
 
-		$this->setExpectedException('Cake\View\Exception\MissingViewException');
+		$this->setExpectedException('Cake\View\Exception\MissingTemplateException');
 		$this->CakeEmail->template('test_plugin_tpl', 'plug_default')->send();
 	}
 

+ 3 - 3
tests/test_app/TestApp/Controller/PagesController.php

@@ -21,7 +21,7 @@ namespace TestApp\Controller;
 use Cake\Core\Configure;
 use Cake\Network\Exception\NotFoundException;
 use Cake\Utility\Inflector;
-use Cake\View\Exception\MissingViewException;
+use Cake\View\Exception\MissingTemplateException;
 
 /**
  * Static content controller
@@ -52,7 +52,7 @@ class PagesController extends AppController {
  * @param mixed What page to display
  * @return void
  * @throws Cake\Network\Exception\NotFoundException When the view file could not be found
- *	or Cake\View\Exception\MissingViewException in debug mode.
+ *	or Cake\View\Exception\MissingTemplateException in debug mode.
  */
 	public function display() {
 		$path = func_get_args();
@@ -80,7 +80,7 @@ class PagesController extends AppController {
 
 		try {
 			$this->render(implode('/', $path));
-		} catch (MissingViewException $e) {
+		} catch (MissingTemplateException $e) {
 			if (Configure::read('debug')) {
 				throw $e;
 			}