summaryrefslogtreecommitdiffstats
path: root/tests/integration/bootstrap.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/bootstrap.php')
-rw-r--r--tests/integration/bootstrap.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php
index 815913e3a..c8d7cc719 100644
--- a/tests/integration/bootstrap.php
+++ b/tests/integration/bootstrap.php
@@ -24,7 +24,6 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
protected function setUp() {
$this->ownCloudVersion = \OCP\Util::getVersion();
$this->cleanUp();
- $this->setupUser($this->userId, $this->userPassword);
$app = new Application();
$this->container = $app->getContainer();
@@ -67,13 +66,13 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
// feeds in folders
foreach($folders as $folder) {
$newFolder = $this->createFolder($folder);
- $this->folders[$newFolder->getName()] = $newFolder;
+ $this->folders[$folder['name']] = $newFolder;
if (array_key_exists($folder['name'], $feeds)) {
foreach ($feeds[$folder['name']] as $feed) {
$feed['folderId'] = $newFolder->getId();
$newFeed = $this->createFeed($feed);
- $this->feeds[$newFeed->getTitle()] = $newFeed;
+ $this->feeds[$feed['title']] = $newFeed;
if (array_key_exists($feed['title'], $items)) {
foreach ($items[$feed['title']] as $item) {
@@ -159,7 +158,7 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
}
- protected function setupUser($user='test', $password='test') {
+ protected function setupUser($user, $password) {
$userManager = \OC::$server->getUserManager();
if ($userManager->userExists($user)) {
@@ -176,13 +175,16 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
$session->login($user, $password);
}
+
private function cleanUp() {
+ $this->setupUser($this->userId, $this->userPassword);
$this->clearNewsDatabase($this->userId);
$this->folders = [];
$this->feeds = [];
$this->items = [];
}
+
protected function tearDown() {
$this->cleanUp();
}