diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-06 17:36:54 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-06 17:36:54 +0100 |
commit | 23dcd8e5bff6a2e366b085ac373638206652f055 (patch) | |
tree | 0bafb8ac92d7bfa3948369d4c0772758fda3c738 /tests/unit/db/MapperFactoryTest.php | |
parent | 31975bfab7d8f94ce3d2f438caa50ac21547d655 (diff) |
fix mysql
Diffstat (limited to 'tests/unit/db/MapperFactoryTest.php')
-rw-r--r-- | tests/unit/db/MapperFactoryTest.php | 50 |
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 |