summaryrefslogtreecommitdiffstats
path: root/tests/unit/db/MapperFactoryTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/db/MapperFactoryTest.php')
-rw-r--r--tests/unit/db/MapperFactoryTest.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/unit/db/MapperFactoryTest.php b/tests/unit/db/MapperFactoryTest.php
new file mode 100644
index 000000000..cb84e78f5
--- /dev/null
+++ b/tests/unit/db/MapperFactoryTest.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * ownCloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Alessandro Cosentino 2012
+ * @copyright Bernhard Posselt 2012, 2014
+ */
+
+namespace OCA\News\Db;
+
+
+class MapperFactoryTest extends \PHPUnit_Framework_TestCase {
+
+ private $db;
+ private $settings;
+
+ public function setUp() {
+ $this->db = $this->getMockBuilder('\OCP\IDb')
+ ->disableOriginalConstructor()
+ ->getMock();
+ }
+
+
+ public function testGetItemMapperSqlite() {
+ $factory = new MapperFactory('sqlite', $this->db);
+
+ $this->assertTrue($factory->getItemMapper() instanceof ItemMapper);
+ }
+
+
+ public function testGetItemMapperPostgres() {
+ $factory = new MapperFactory('pgsql', $this->db);
+
+ $this->assertTrue($factory->getItemMapper() instanceof ItemMapper);
+ }
+
+
+ public function testGetItemMapperMysql() {
+ $factory = new MapperFactory('mysql', $this->db);
+
+ $this->assertTrue($factory->getItemMapper() instanceof \OCA\News\Db\Mysql\ItemMapper);
+ }
+
+
+} \ No newline at end of file