Skip to content

Commit

Permalink
Update exception name.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Oct 23, 2014
1 parent 632167d commit 4fb7da8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Error/ExceptionRenderer.php
Expand Up @@ -25,7 +25,7 @@
use Cake\Network\Response;
use Cake\Routing\Router;
use Cake\Utility\Inflector;
use Cake\View\Exception\MissingViewException;
use Cake\View\Exception\MissingTemplateException;
use Exception;

/**
Expand Down Expand Up @@ -270,7 +270,7 @@ protected function _outputMessage($template) {
$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');
Expand Down
6 changes: 3 additions & 3 deletions src/View/Cell.php
Expand Up @@ -21,7 +21,7 @@
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;

/**
Expand Down Expand Up @@ -143,7 +143,7 @@ public function __construct(Request $request = null, Response $response = null,
* @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) {
Expand All @@ -164,7 +164,7 @@ public function render($template = null) {

try {
return $this->View->render($template);
} catch (MissingViewException $e) {
} catch (MissingTemplateException $e) {
throw new MissingCellViewException(['file' => $template, 'name' => $name]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Controller/PagesControllerTest.php
Expand Up @@ -21,7 +21,7 @@
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;

/**
Expand Down Expand Up @@ -60,7 +60,7 @@ public function testMissingView() {
/**
* 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
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Error/ExceptionRendererTest.php
Expand Up @@ -38,7 +38,7 @@
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
Expand Down Expand Up @@ -489,7 +489,7 @@ public static function exceptionProvider() {
404
),
array(
new MissingViewException(array('file' => '/posts/about.ctp')),
new MissingTemplateException(array('file' => '/posts/about.ctp')),
array(
"/posts\/about.ctp/"
),
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Network/Email/EmailTest.php
Expand Up @@ -22,7 +22,7 @@
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
Expand Down Expand Up @@ -1644,7 +1644,7 @@ public function testSendRenderPlugin() {
$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();
}

Expand Down
6 changes: 3 additions & 3 deletions tests/test_app/TestApp/Controller/PagesController.php
Expand Up @@ -21,7 +21,7 @@
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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -80,7 +80,7 @@ public function display() {

try {
$this->render(implode('/', $path));
} catch (MissingViewException $e) {
} catch (MissingTemplateException $e) {
if (Configure::read('debug')) {
throw $e;
}
Expand Down

0 comments on commit 4fb7da8

Please sign in to comment.