From 963a03e108632931c202e9a13bb59914a5bbb274 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 15 Sep 2020 11:17:33 +0200 Subject: [PATCH] Fix unit tests Signed-off-by: Joas Schilling --- tests/lib/Settings/ManagerTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php index 761f5f9a5c19f..3d8ae130dbfb7 100644 --- a/tests/lib/Settings/ManagerTest.php +++ b/tests/lib/Settings/ManagerTest.php @@ -116,6 +116,10 @@ public function testGetPersonalSections() { $this->manager->registerSection('personal', \OCA\WorkflowEngine\Settings\Section::class); + $this->container->method('query') + ->with(\OCA\Settings\Personal\Additional::class) + ->willReturn($this->createMock(\OCA\Settings\Personal\Additional::class)); + $this->url->expects($this->exactly(3)) ->method('imagePath') ->willReturnMap([ @@ -183,6 +187,10 @@ public function testGetPersonalSectionsEmptySection() { ['core', 'clients/phone.svg', '3'], ]); + $this->container->method('query') + ->with(\OCA\Settings\Personal\Additional::class) + ->willReturn($this->createMock(\OCA\Settings\Personal\Additional::class)); + $this->assertArraySubset([ 0 => [new Section('personal-info', 'Personal info', 0, '1')], 5 => [new Section('security', 'Security', 0, '2')], @@ -290,6 +298,10 @@ public function testSameSectionAsPersonalAndAdmin() { ['settings', 'help.svg', '4'], ]); + $this->container->method('query') + ->with(\OCA\Settings\Personal\Additional::class) + ->willReturn($this->createMock(\OCA\Settings\Personal\Additional::class)); + $this->assertEquals([ 0 => [new Section('personal-info', 'Personal info', 0, '1')], 5 => [new Section('security', 'Security', 0, '2')],