Skip to content

Commit

Permalink
fix(tests): Adjust users for test
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Nov 27, 2023
1 parent 6df04a9 commit 1123b21
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Integration/Api/ApiV2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
use OCP\DB\QueryBuilder\IQueryBuilder;
use Test\TestCase;

/**
* @group DB
*/
class ApiV2Test extends TestCase {
/** @var GuzzleHttp\Client */
private $http;
Expand Down Expand Up @@ -197,6 +200,18 @@ private function setTestForms() {
*/
public function setUp(): void {
parent::setUp();
$userManager = \OC::$server->getUserManager();
if (!$userManager->userExists('test')) {
$user = $userManager->createUser('test', 'test');
$user->setDisplayName('Test Displayname');
}
foreach ([1, 2, 3] as $number) {
if (!$userManager->userExists("user$number")) {
$user = $userManager->createUser("user$number", "user$number");
$user->setDisplayName("User No. $number");
}
}

$this->setTestForms();

$qb = TestCase::$realDatabase->getQueryBuilder();
Expand Down

0 comments on commit 1123b21

Please sign in to comment.