summaryrefslogtreecommitdiffstats
path: root/tests/unit/db
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-02 21:34:17 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-02 21:34:17 +0200
commite231ba2ec1908f0ac914bd8f1b73771d707719b8 (patch)
treed26d6eddda7ee5c26c345f84804edb2592f6e395 /tests/unit/db
parent9c9625b0f6520f80996e17304805d8bae421f44c (diff)
add custom app.json config and parser
Diffstat (limited to 'tests/unit/db')
-rw-r--r--tests/unit/db/MapperFactoryTest.php21
1 files changed, 3 insertions, 18 deletions
diff --git a/tests/unit/db/MapperFactoryTest.php b/tests/unit/db/MapperFactoryTest.php
index a83eca8ec..2f0e86be4 100644
--- a/tests/unit/db/MapperFactoryTest.php
+++ b/tests/unit/db/MapperFactoryTest.php
@@ -23,9 +23,6 @@ class MapperFactoryTest extends \PHPUnit_Framework_TestCase {
private $settings;
public function setUp() {
- $this->settings = $this->getMockBuilder('\OCP\IConfig')
- ->disableOriginalConstructor()
- ->getMock();
$this->db = $this->getMockBuilder('\OCA\News\Core\Db')
->disableOriginalConstructor()
->getMock();
@@ -33,33 +30,21 @@ class MapperFactoryTest extends \PHPUnit_Framework_TestCase {
public function testGetItemMapperSqlite() {
- $this->settings->expects($this->once())
- ->method('getSystemValue')
- ->with($this->equalTo('dbtype'))
- ->will($this->returnValue('sqlite'));
- $factory = new MapperFactory($this->settings, $this->db);
+ $factory = new MapperFactory('sqlite', $this->db);
$this->assertTrue($factory->getItemMapper() instanceof ItemMapper);
}
public function testGetItemMapperMysql() {
- $this->settings->expects($this->once())
- ->method('getSystemValue')
- ->with($this->equalTo('dbtype'))
- ->will($this->returnValue('mysql'));
- $factory = new MapperFactory($this->settings, $this->db);
+ $factory = new MapperFactory('mysql', $this->db);
$this->assertTrue($factory->getItemMapper() instanceof ItemMapper);
}
public function testGetItemMapperPostgres() {
- $this->settings->expects($this->once())
- ->method('getSystemValue')
- ->with($this->equalTo('dbtype'))
- ->will($this->returnValue('pgsql'));
- $factory = new MapperFactory($this->settings, $this->db);
+ $factory = new MapperFactory('pgsql', $this->db);
$this->assertTrue($factory->getItemMapper() instanceof \OCA\News\Db\Postgres\ItemMapper);
}