From e231ba2ec1908f0ac914bd8f1b73771d707719b8 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 2 May 2014 21:34:17 +0200 Subject: add custom app.json config and parser --- tests/unit/db/MapperFactoryTest.php | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'tests/unit/db') 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); } -- cgit v1.2.3