trustedServers = $this->getMockBuilder('\OCA\Federation\TrustedServers')->disableOriginalConstructor()->getMock(); $this->admin = new Admin( $this->trustedServers, $this->createMock(IL10N::class) ); } public function testGetForm() { $this->trustedServers ->expects($this->once()) ->method('getServers') ->willReturn(['myserver', 'secondserver']); $params = [ 'trustedServers' => ['myserver', 'secondserver'], ]; $expected = new TemplateResponse('federation', 'settings-admin', $params, ''); $this->assertEquals($expected, $this->admin->getForm()); } public function testGetSection() { $this->assertSame('sharing', $this->admin->getSection()); } public function testGetPriority() { $this->assertSame(30, $this->admin->getPriority()); } }