summaryrefslogtreecommitdiffstats
path: root/tests/integration/db/ItemMapperTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/db/ItemMapperTest.php')
-rw-r--r--tests/integration/db/ItemMapperTest.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/integration/db/ItemMapperTest.php b/tests/integration/db/ItemMapperTest.php
new file mode 100644
index 000000000..d0013f631
--- /dev/null
+++ b/tests/integration/db/ItemMapperTest.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace OCA\News\Db;
+
+require_once __DIR__ . '/../bootstrap.php';
+
+use \OCA\News\AppInfo\Application;
+use \OCA\News\Tests\Integration\NewsIntegrationTest;
+
+class ItemMapperTest extends NewsIntegrationTest {
+
+ private $container;
+ private $itemMapper;
+
+ protected function setUp() {
+ parent::setUp();
+ $app = new Application();
+ $this->container = $app->getContainer();
+ $this->itemMapper = $this->container->query('ItemMapper');
+ }
+
+
+ public function testInsert() {
+ $item = new Item();
+ $item->setTitle('my title');
+
+ $created = $this->itemMapper->insert($item);
+
+ $fetched = $this->itemMapper->find($created->getId(), $this->userId);
+
+ $this->assertEquals($item->getTitle(), $fetched->getTitle());
+ }
+
+} \ No newline at end of file