aboutsummaryrefslogtreecommitdiffstats
path: root/demos/dialog/default.html
blob: 41c81166824aba2163c9104f3fde5e5399561544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>jQuery UI Dialog - Default functionality</title>
	<link rel="stylesheet" href="../../themes/base/all.css">
	<script src="../../external/jquery/jquery.js"></script>
	<script src="../../ui/core.js"></script>
	<script src="../../ui/widget.js"></script>
	<script src="../../ui/mouse.js"></script>
	<script src="../../ui/draggable.js"></script>
	<script src="../../ui/position.js"></script>
	<script src="../../ui/resizable.js"></script>
	<script src="../../ui/button.js"></script>
	<script src="../../ui/dialog.js"></script>
	<link rel="stylesheet" href="../demos.css">
	<script>
	$(function() {
		$( "#dialog" ).dialog();
	});
	</script>
</head>
<body>

<div id="dialog" title="Basic dialog">
	<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

<div class="demo-description">
<p>The basic dialog window is an overlay positioned within the viewport and is protected from page content (like select elements) shining through with an iframe.  It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.</p>
</div>
</body>
</html>
ckport/44130/stable26'>backport/44130/stable26 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/tests/Settings/Admin/ServerTest.php
blob: f9c10d864e428b9f60f0c0e8d7f27574c4aaa29d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OCA\Settings\Tests\Settings\Admin;

use OC\Profile\ProfileManager;
use OCA\Settings\Settings\Admin\Server;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IL10N;
use OCP\IUrlGenerator;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

/**
 * @group DB
 */
class ServerTest extends TestCase {
	/** @var IDBConnection */
	private $connection;
	/** @var Server&MockObject */
	private $admin;
	/** @var IInitialState&MockObject */
	private $initialStateService;
	/** @var ProfileManager&MockObject */
	private $profileManager;
	/** @var ITimeFactory&MockObject */
	private $timeFactory;
	/** @var IConfig&MockObject */
	private $config;
	/** @var IAppConfig&MockObject */
	private $appConfig;
	/** @var IL10N&MockObject */
	private $l10n;
	/** @var IUrlGenerator&MockObject */
	private $urlGenerator;

	protected function setUp(): void {
		parent::setUp();
		$this->connection = \OCP\Server::get(IDBConnection::class);
		$this->initialStateService = $this->createMock(IInitialState::class);
		$this->profileManager = $this->createMock(ProfileManager::class);
		$this->timeFactory = $this->createMock(ITimeFactory::class);
		$this->config = $this->createMock(IConfig::class);
		$this->appConfig = $this->createMock(IAppConfig::class);
		$this->l10n = $this->createMock(IL10N::class);
		$this->urlGenerator = $this->createMock(IUrlGenerator::class);

		$this->admin = $this->getMockBuilder(Server::class)
			->onlyMethods(['cronMaxAge'])
			->setConstructorArgs([
				$this->connection,
				$this->initialStateService,
				$this->profileManager,
				$this->timeFactory,
				$this->urlGenerator,
				$this->config,
				$this->appConfig,
				$this->l10n,
			])
			->getMock();
	}

	public function testGetForm(): void {
		$this->admin->expects($this->once())
			->method('cronMaxAge')
			->willReturn(1337);
		$this->config
			->expects($this->any())
			->method('getAppValue')
			->willReturnMap([
				['core', 'lastcron', '0', '0'],
				['core', 'cronErrors', ''],
			]);
		$this->appConfig
			->expects($this->any())
			->method('getValueString')
			->willReturnCallback(fn ($a, $b, $default) => $default);
		$this->profileManager
			->expects($this->exactly(2))
			->method('isProfileEnabled')
			->willReturn(true);
		$expected = new TemplateResponse(
			'settings',
			'settings/admin/server',
			[
				'profileEnabledGlobally' => true,
			],
			''
		);

		$this->assertEquals($expected, $this->admin->getForm());
	}

	public function testGetSection(): void {
		$this->assertSame('server', $this->admin->getSection());
	}

	public function testGetPriority(): void {
		$this->assertSame(0, $this->admin->getPriority());
	}
}