Browse Source

Rename MissingViewException to MissingTemplateException.

ADmad 11 years ago
parent
commit
147fd6bfee

+ 2 - 2
src/Template/Error/missing_view.ctp

@@ -14,7 +14,7 @@
  */
 use Cake\Utility\Inflector;
 ?>
-<h2>Missing View</h2>
+<h2>Missing Template</h2>
 <p class="error">
 	<strong>Error: </strong>
 	<?= sprintf('The view for <em>%sController::%s()</em> was not found.', h(Inflector::camelize($this->request->controller)), h($this->request->action)); ?>
@@ -38,7 +38,7 @@ use Cake\Utility\Inflector;
 
 <p class="notice">
 	<strong>Notice: </strong>
-	<?= sprintf('If you want to customize this error message, create %s', APP_DIR . DS . 'Template' . DS . 'Error' . DS . 'missing_view.ctp') ?>
+	<?= sprintf('If you want to customize this error message, create %s', APP_DIR . DS . 'Template' . DS . 'Error' . DS . 'missing_template.ctp') ?>
 </p>
 
 <?= $this->element('exception_stack_trace'); ?>

+ 3 - 3
src/View/Exception/MissingViewException.php

@@ -16,11 +16,11 @@ namespace Cake\View\Exception;
 use Cake\Core\Exception\Exception;
 
 /**
- * Used when a view file cannot be found.
+ * Used when a template file cannot be found.
  *
  */
-class MissingViewException extends Exception {
+class MissingTemplateException extends Exception {
 
-	protected $_messageTemplate = 'View file "%s" is missing.';
+	protected $_messageTemplate = 'Template file "%s" is missing.';
 
 }

+ 2 - 2
src/View/View.php

@@ -803,7 +803,7 @@ class View {
  *
  * @param string $name Controller action to find template filename for
  * @return string Template filename
- * @throws \Cake\View\Exception\MissingViewException when a view file could not be found.
+ * @throws \Cake\View\Exception\MissingTemplateException when a view file could not be found.
  */
 	protected function _getViewFileName($name = null) {
 		$subDir = null;
@@ -838,7 +838,7 @@ class View {
 				return $this->_checkFilePath($path . $name . $this->_ext, $path);
 			}
 		}
-		throw new Exception\MissingViewException(array('file' => $name . $this->_ext));
+		throw new Exception\MissingTemplateException(array('file' => $name . $this->_ext));
 	}
 
 /**

+ 2 - 2
tests/TestCase/View/ViewTest.php

@@ -667,10 +667,10 @@ class ViewTest extends TestCase {
 /**
  * Test for missing views
  *
- * @expectedException \Cake\View\Exception\MissingViewException
+ * @expectedException \Cake\View\Exception\MissingTemplateException
  * @return void
  */
-	public function testMissingView() {
+	public function testMissingTemplate() {
 		$viewOptions = ['plugin' => null,
 			'name' => 'Pages',
 			'viewPath' => 'Pages'