diff options
Diffstat (limited to 'tests/unit/db')
-rw-r--r-- | tests/unit/db/FeedMapperTest.php | 2 | ||||
-rw-r--r-- | tests/unit/db/FolderMapperTest.php | 30 | ||||
-rw-r--r-- | tests/unit/db/ItemMapperTest.php | 2 | ||||
-rw-r--r-- | tests/unit/db/postgres/ItemMapperTest.php | 6 |
4 files changed, 20 insertions, 20 deletions
diff --git a/tests/unit/db/FeedMapperTest.php b/tests/unit/db/FeedMapperTest.php index 83dcc40ef..93137d8d4 100644 --- a/tests/unit/db/FeedMapperTest.php +++ b/tests/unit/db/FeedMapperTest.php @@ -14,7 +14,7 @@ namespace OCA\News\Db; -class FeedMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { +class FeedMapperTest extends \Test\AppFramework\Db\MapperTestUtility { private $mapper; private $feeds; diff --git a/tests/unit/db/FolderMapperTest.php b/tests/unit/db/FolderMapperTest.php index b9196ef6b..6a2e94588 100644 --- a/tests/unit/db/FolderMapperTest.php +++ b/tests/unit/db/FolderMapperTest.php @@ -14,12 +14,12 @@ namespace OCA\News\Db; -class FolderMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { +class FolderMapperTest extends \Test\AppFramework\Db\MapperTestUtility { private $folderMapper; private $folders; private $user; - + protected function setUp(){ parent::setUp(); @@ -45,12 +45,12 @@ class FolderMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { $sql = 'SELECT * FROM `*PREFIX*news_folders` ' . 'WHERE `id` = ? ' . 'AND `user_id` = ?'; - + $this->setMapperResult($sql, [$id, $userId], $rows); - + $result = $this->folderMapper->find($id, $userId); $this->assertEquals($this->folders[0], $result); - + } @@ -60,13 +60,13 @@ class FolderMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { $sql = 'SELECT * FROM `*PREFIX*news_folders` ' . 'WHERE `id` = ? ' . 'AND `user_id` = ?'; - + $this->setMapperResult($sql, [$id, $userId]); - + $this->setExpectedException('\OCP\AppFramework\Db\DoesNotExistException'); - $this->folderMapper->find($id, $userId); + $this->folderMapper->find($id, $userId); } - + public function testFindMoreThanOneResultFound(){ $userId = 'john'; @@ -75,9 +75,9 @@ class FolderMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { $sql = 'SELECT * FROM `*PREFIX*news_folders` ' . 'WHERE `id` = ? ' . 'AND `user_id` = ?'; - + $this->setMapperResult($sql, [$id, $userId], $rows); - + $this->setExpectedException('\OCP\AppFramework\Db\MultipleObjectsReturnedException'); $this->folderMapper->find($id, $userId); } @@ -90,9 +90,9 @@ class FolderMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { $sql = 'SELECT * FROM `*PREFIX*news_folders` ' . 'WHERE `user_id` = ? ' . 'AND `deleted_at` = 0'; - + $this->setMapperResult($sql, [$userId], $rows); - + $result = $this->folderMapper->findAllFromUser($userId); $this->assertEquals($this->folders, $result); } @@ -105,9 +105,9 @@ class FolderMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { $sql = 'SELECT * FROM `*PREFIX*news_folders` ' . 'WHERE `name` = ? ' . 'AND `user_id` = ?'; - + $this->setMapperResult($sql, [$folderName, $userId], $rows); - + $result = $this->folderMapper->findByName($folderName, $userId); $this->assertEquals($this->folders, $result); } diff --git a/tests/unit/db/ItemMapperTest.php b/tests/unit/db/ItemMapperTest.php index b9feba977..6b5082d9b 100644 --- a/tests/unit/db/ItemMapperTest.php +++ b/tests/unit/db/ItemMapperTest.php @@ -14,7 +14,7 @@ namespace OCA\News\Db; -class ItemMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { +class ItemMapperTest extends \Test\AppFramework\Db\MapperTestUtility { private $mapper; private $items; diff --git a/tests/unit/db/postgres/ItemMapperTest.php b/tests/unit/db/postgres/ItemMapperTest.php index d7c684c14..528f6003a 100644 --- a/tests/unit/db/postgres/ItemMapperTest.php +++ b/tests/unit/db/postgres/ItemMapperTest.php @@ -17,7 +17,7 @@ use \OCA\News\Db\Item; use \OCA\News\Db\StatusFlag; -class ItemMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { +class ItemMapperTest extends \Test\AppFramework\Db\MapperTestUtility { private $mapper; private $items; @@ -65,7 +65,7 @@ class ItemMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { public function testDeleteReadOlderThanThresholdDoesNotDeleteBelowThreshold(){ $status = StatusFlag::STARRED | StatusFlag::UNREAD; $sql = 'SELECT COUNT(*) - `feeds`.`articles_per_update` AS `size`, ' . - '`items`.`feed_id` AS `feed_id` ' . + '`items`.`feed_id` AS `feed_id` ' . 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . @@ -89,7 +89,7 @@ class ItemMapperTest extends \OCP\AppFramework\Db\MapperTestUtility { $status = StatusFlag::STARRED | StatusFlag::UNREAD; $sql1 = 'SELECT COUNT(*) - `feeds`.`articles_per_update` AS `size`, ' . - '`items`.`feed_id` AS `feed_id` ' . + '`items`.`feed_id` AS `feed_id` ' . 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . |