summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/integration/bootstrap.php13
-rw-r--r--tests/integration/db/ItemMapperTest.php3
2 files changed, 10 insertions, 6 deletions
diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php
index b57e14e58..fc4308ca8 100644
--- a/tests/integration/bootstrap.php
+++ b/tests/integration/bootstrap.php
@@ -7,6 +7,7 @@ require_once __DIR__ . '/../../../../lib/base.php';
class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
protected $userId = 'test';
+ protected $userPassword = 'test';
protected function setupNewsDatabase($user='test') {
$db = \OC::$server->getDb();
@@ -23,22 +24,22 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
}
- protected function setupUser($user='test') {
+ protected function setupUser($user='test', $password='test') {
$userManager = \OC::$server->getUserManager();
if ($userManager->userExists($user)) {
- $userManager->delete($user);
+ $userManager->get($user)->delete();
}
- $userManager->createUser('test', 'test');
+ $userManager->createUser($user, $password);
$session = \OC::$server->getUserSession();
- $session->setUser($userManager->get($user));
+ $session->login($user, $password);
}
- protected function setUp($user='test') {
- $this->setupUser($user);
+ protected function setUp($user='test', $password='test') {
+ $this->setupUser($user, $password);
$this->setupNewsDatabase($user);
}
diff --git a/tests/integration/db/ItemMapperTest.php b/tests/integration/db/ItemMapperTest.php
index d0013f631..82c5d880b 100644
--- a/tests/integration/db/ItemMapperTest.php
+++ b/tests/integration/db/ItemMapperTest.php
@@ -23,12 +23,15 @@ class ItemMapperTest extends NewsIntegrationTest {
public function testInsert() {
$item = new Item();
$item->setTitle('my title');
+ $item->setGuid('test');
$created = $this->itemMapper->insert($item);
$fetched = $this->itemMapper->find($created->getId(), $this->userId);
$this->assertEquals($item->getTitle(), $fetched->getTitle());
+ $this->assertEquals($item->getGuid(), $fetched->getGuid());
+ $this->assertEquals($item->getGuidHash(), $fetched->getGuidHash());
}
} \ No newline at end of file