Skip to content

Commit

Permalink
fix: failing tests for setup check
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <anna@nextcloud.com>
  • Loading branch information
miaulalala committed Jun 10, 2024
1 parent 6c92419 commit ff3a9c7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/settings/tests/Controller/CheckSetupControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\DB\IResult;
use OCP\DB\QueryBuilder\IFunctionBuilder;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\DB\QueryBuilder\IQueryFunction;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
Expand Down Expand Up @@ -612,8 +615,13 @@ public function testCheck() {
$this->connection->method('getDatabasePlatform')
->willReturn($sqlitePlatform);
$queryBuilder = $this->getMockBuilder(IQueryBuilder::class)->getMock();
$this->connection->method('getQueryBuilder')
->willReturn($queryBuilder);
$functionBuilder = $this->getMockBuilder(IFunctionBuilder::class)->getMock();
$this->connection->method('getQueryBuilder')->willReturn($queryBuilder);
$queryBuilder->method('func')->willReturn($functionBuilder);
$queryBuilder->method('select')->willReturn($queryBuilder);
$queryBuilder->method('from')->willReturn($queryBuilder);
$queryBuilder->method('executeQuery')->willReturn($this->getMockBuilder(IResult::class)->getMock());
$functionBuilder->method('count')->willReturn($this->getMockBuilder(IQueryFunction::class)->getMock());

$expected = new DataResponse(
[
Expand Down

0 comments on commit ff3a9c7

Please sign in to comment.