diff options
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/config/AppConfigTest.php | 33 | ||||
-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 |
5 files changed, 21 insertions, 52 deletions
diff --git a/tests/unit/config/AppConfigTest.php b/tests/unit/config/AppConfigTest.php index 470442bc5..9053c6cbd 100644 --- a/tests/unit/config/AppConfigTest.php +++ b/tests/unit/config/AppConfigTest.php @@ -32,12 +32,11 @@ class AppConfigTest extends \PHPUnit_Framework_TestCase { ->getMock(); $phpVersion = '5.3'; $ownCloudVersion = '6.0.3'; - $installedApps = ['contacts' => '5.3', 'calendar' => '2.3']; $installedExtensions = ['curl' => '4.3']; $databaseType = 'oracle'; $this->config = new AppConfig($this->nav, $this->l10n, - $this->url, $phpVersion, $ownCloudVersion, $installedApps, + $this->url, $phpVersion, $ownCloudVersion, $installedExtensions, $databaseType); } @@ -160,22 +159,6 @@ class AppConfigTest extends \PHPUnit_Framework_TestCase { /** * @expectedException \OCA\News\Config\DependencyException */ - public function testAppVersion() { - $this->config->loadConfig([ - 'dependencies' => [ - 'apps' => [ - 'contacts' => '5.3', - 'calendar' => '>2.3' - ] - ] - ]); - $this->config->testDependencies(); - } - - - /** - * @expectedException \OCA\News\Config\DependencyException - */ public function testLibsVersion() { $this->config->loadConfig([ 'dependencies' => [ @@ -203,20 +186,6 @@ class AppConfigTest extends \PHPUnit_Framework_TestCase { } - /** - * @expectedException \OCA\News\Config\DependencyException - */ - public function testAppsExistence() { - $this->config->loadConfig([ - 'dependencies' => [ - 'apps' => [ - 'news' => '>=4.3,<=4.3' - ] - ] - ]); - $this->config->testDependencies(); - } - /** * @expectedException \OCA\News\Config\DependencyException 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` ' . |