Просмотр исходного кода

Fix DAO exception

Change the name and messages
Alexis Degrugillier 11 лет назад
Родитель
Сommit
96d5d9d034
3 измененных файлов с 7 добавлено и 7 удалено
  1. 1 1
      app/Exceptions/DAOException.php
  2. 4 4
      app/Models/UserQuery.php
  3. 2 2
      tests/app/Models/UserQueryTest.php

+ 1 - 1
app/Exceptions/DAOException.php

@@ -1,5 +1,5 @@
 <?php
 
-class FreshRSS_DAOException extends \Exception {
+class FreshRSS_DAO_Exception extends \Exception {
 
 }

+ 4 - 4
app/Models/UserQuery.php

@@ -104,11 +104,11 @@ class FreshRSS_UserQuery {
 	 * Parse the query string when it is a "category" query
 	 *
 	 * @param integer $id
-	 * @throws FreshRSS_DAOException
+	 * @throws FreshRSS_DAO_Exception
 	 */
 	private function parseCategory($id) {
 		if (is_null($this->category_dao)) {
-			throw new FreshRSS_DAOException('Category DAO is not loaded i UserQuery');
+			throw new FreshRSS_DAO_Exception('Category DAO is not loaded in UserQuery');
 		}
 		$category = $this->category_dao->searchById($id);
 		if ($category) {
@@ -123,11 +123,11 @@ class FreshRSS_UserQuery {
 	 * Parse the query string when it is a "feed" query
 	 *
 	 * @param integer $id
-	 * @throws FreshRSS_DAOException
+	 * @throws FreshRSS_DAO_Exception
 	 */
 	private function parseFeed($id) {
 		if (is_null($this->feed_dao)) {
-			throw new FreshRSS_DAOException('Feed DAO is not loaded i UserQuery');
+			throw new FreshRSS_DAO_Exception('Feed DAO is not loaded in UserQuery');
 		}
 		$feed = $this->feed_dao->searchById($id);
 		if ($feed) {

+ 2 - 2
tests/app/Models/UserQueryTest.php

@@ -20,7 +20,7 @@ class UserQueryTest extends \PHPUnit_Framework_TestCase {
 	}
 
 	/**
-	 * @expectedException Exceptions/FreshRSS_DAOException
+	 * @expectedException Exceptions/FreshRSS_DAO_Exception
 	 * @expectedExceptionMessage Category DAO is not loaded in UserQuery
 	 */
 	public function test__construct_whenCategoryQueryAndNoDao_throwsException() {
@@ -48,7 +48,7 @@ class UserQueryTest extends \PHPUnit_Framework_TestCase {
 	}
 
 	/**
-	 * @expectedException Exceptions/FreshRSS_DAOException
+	 * @expectedException Exceptions/FreshRSS_DAO_Exception
 	 * @expectedExceptionMessage Feed DAO is not loaded in UserQuery
 	 */
 	public function test__construct_whenFeedQueryAndNoDao_throwsException() {