Browse Source

Replacment Exception() on InitializationException(), GeneralException() in /view

master
Vyacheslav Agafonov 13 years ago
parent
commit
25ba2abf54
  1. 2
      tests/view/PHPViewTest.php
  2. 2
      tests/view/helpers/MsgViewHelperTest.php
  3. 2
      view/PHPView.php
  4. 2
      view/helpers/MsgViewHelper.php

2
tests/view/PHPViewTest.php

@ -139,7 +139,7 @@ class PHPViewTest extends PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException InitializationException
* @expectedException GeneralException
* @expectedExceptionMessage Template * @expectedExceptionMessage Template
*/ */
public function testErrorTemplate() public function testErrorTemplate()

2
tests/view/helpers/MsgViewHelperTest.php

@ -41,7 +41,7 @@ class MsgViewHelperTest extends PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException InitializationException
* @expectedException GeneralException
* @expectedExceptionMessage Unknown message type * @expectedExceptionMessage Unknown message type
*/ */
public function testWrongType() public function testWrongType()

2
view/PHPView.php

@ -92,7 +92,7 @@ class PHPView implements iView
ob_start(); ob_start();
if (!is_readable($this->template)) { if (!is_readable($this->template)) {
ob_clean(); ob_clean();
throw new InitializationException('Template "' . $this->template .'" not found.');
throw new GeneralException('Template "' . $this->template .'" not found.');
} }
include($this->template); include($this->template);
return ob_get_clean(); return ob_get_clean();

2
view/helpers/MsgViewHelper.php

@ -21,7 +21,7 @@ class MsgViewHelper extends ViewHelper
{ {
if ($msg && $type) { if ($msg && $type) {
if (!in_array($type, array(self::SUCCESS, self::ERROR))) { if (!in_array($type, array(self::SUCCESS, self::ERROR))) {
throw new InitializationException('Unknown message type: "' . $type . '"');
throw new GeneralException('Unknown message type: "' . $type . '"');
} }
Session::set(__CLASS__, array('message' => $msg, 'type' => $type)); Session::set(__CLASS__, array('message' => $msg, 'type' => $type));
} }

Loading…
Cancel
Save