diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-08-27 13:27:29 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-08-27 13:27:29 +0200 |
commit | adad6ca280f2284a0ea4a1c41c8adea4ae1b141a (patch) | |
tree | f9f6d05832b4b57c6c07837c6e988f71dd04954a /tests/unit/db | |
parent | c88b300bad389fd0ddb888111a8bc56f71782d3c (diff) |
clean up app container
Diffstat (limited to 'tests/unit/db')
-rw-r--r-- | tests/unit/db/MapperFactoryTest.php | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/unit/db/MapperFactoryTest.php b/tests/unit/db/MapperFactoryTest.php index cb84e78f5..341dea0e9 100644 --- a/tests/unit/db/MapperFactoryTest.php +++ b/tests/unit/db/MapperFactoryTest.php @@ -13,38 +13,37 @@ namespace OCA\News\Db; +use PHPUnit_Framework_TestCase; -class MapperFactoryTest extends \PHPUnit_Framework_TestCase { +use OCP\IDb; + +use OCA\News\Db\Mysql\ItemMapper as MysqlMapper; + + +class MapperFactoryTest extends PHPUnit_Framework_TestCase { private $db; private $settings; public function setUp() { - $this->db = $this->getMockBuilder('\OCP\IDb') + $this->db = $this->getMockBuilder(IDb::class) ->disableOriginalConstructor() ->getMock(); } - public function testGetItemMapperSqlite() { - $factory = new MapperFactory('sqlite', $this->db); - - $this->assertTrue($factory->getItemMapper() instanceof ItemMapper); + $factory = new MapperFactory($this->db, 'sqlite'); + $this->assertTrue($factory->build() instanceof ItemMapper); } - public function testGetItemMapperPostgres() { - $factory = new MapperFactory('pgsql', $this->db); - - $this->assertTrue($factory->getItemMapper() instanceof ItemMapper); + $factory = new MapperFactory($this->db, 'pgsql'); + $this->assertTrue($factory->build() instanceof ItemMapper); } - public function testGetItemMapperMysql() { - $factory = new MapperFactory('mysql', $this->db); - - $this->assertTrue($factory->getItemMapper() instanceof \OCA\News\Db\Mysql\ItemMapper); + $factory = new MapperFactory($this->db, 'mysql'); + $this->assertTrue($factory->build() instanceof MysqlMapper); } - -}
\ No newline at end of file +} |