Skip to content

Commit 8587cc3

Browse files
fixup! Add dedicated API for apps' bootstrapping process
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent 8c54e4a commit 8587cc3

3 files changed

Lines changed: 76 additions & 0 deletions

File tree

lib/public/AppFramework/Bootstrap/IBootstrap.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,22 @@
2525

2626
namespace OCP\AppFramework\Bootstrap;
2727

28+
/**
29+
* @since 20.0.0
30+
*/
2831
interface IBootstrap {
32+
33+
/**
34+
* @param IRegistrationContext $context
35+
*
36+
* @since 20.0.0
37+
*/
2938
public function register(IRegistrationContext $context): void;
3039

40+
/**
41+
* @param IBootContext $context
42+
*
43+
* @since 20.0.0
44+
*/
3145
public function boot(IBootContext $context): void;
3246
}

lib/public/AppFramework/Bootstrap/IRegistrationContext.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
use OCP\EventDispatcher\IEventDispatcher;
3030
use OCP\IContainer;
3131

32+
/**
33+
* The context object passed to IBootstrap::register
34+
*
35+
* @since 20.0.0
36+
* @see IBootstrap::register()
37+
*/
3238
interface IRegistrationContext {
3339

3440
/**
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
7+
*
8+
* @author 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
9+
*
10+
* @license GNU AGPL version 3 or any later version
11+
*
12+
* This program is free software: you can redistribute it and/or modify
13+
* it under the terms of the GNU Affero General Public License as
14+
* published by the Free Software Foundation, either version 3 of the
15+
* License, or (at your option) any later version.
16+
*
17+
* This program is distributed in the hope that it will be useful,
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
* GNU Affero General Public License for more details.
21+
*
22+
* You should have received a copy of the GNU Affero General Public License
23+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24+
*/
25+
26+
namespace lib\AppFramework\Bootstrap;
27+
28+
use OC\AppFramework\Bootstrap\Coordinator;
29+
use OC\ServerContainer;
30+
use OCP\App\IAppManager;
31+
use OCP\EventDispatcher\IEventDispatcher;
32+
use OCP\ILogger;
33+
use Test\TestCase;
34+
35+
class CoordinatorTest extends TestCase {
36+
37+
private $appManager;
38+
private $serverContainer;
39+
private $eventDispatcher;
40+
41+
protected function setUp(): void {
42+
parent::setUp();
43+
44+
$this->appManager = $this->createMock(IAppManager::class);
45+
$this->serverContainer = $this->createMock(ServerContainer::class);
46+
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
47+
48+
$this->coordinator = new Coordinator(
49+
$this->appManager,
50+
$this->serverContainer,
51+
$this->eventDispatcher,
52+
$this->createMock(ILogger::class)
53+
);
54+
}
55+
56+
}

0 commit comments

Comments
 (0)