aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-10-12 20:04:33 +0200
committerGitHub <noreply@github.com>2020-10-12 20:04:33 +0200
commit14af2246f36a8360d8f3eca7056c99861804d3bf (patch)
treedb31ef30b4b480301c7a6eca521f721d51cd15b7
parentff84fc400aa13f2e0b651ac67afccaec96b5fef1 (diff)
parent91d445909ac4fea3e57b07dbfa0fb8dc6ad5223c (diff)
downloadnextcloud-server-14af2246f36a8360d8f3eca7056c99861804d3bf.tar.gz
nextcloud-server-14af2246f36a8360d8f3eca7056c99861804d3bf.zip
Merge pull request #23378 from R0Wi/bugfix/registration_typo
Fix typo 'shared'
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php2
-rw-r--r--tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php16
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index 0f408380e88..023590596e3 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -203,7 +203,7 @@ class RegistrationContext {
"appId" => $appId,
"name" => $name,
"factory" => $factory,
- "sharred" => $shared,
+ "shared" => $shared,
];
}
diff --git a/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php b/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php
index 8441b6e983d..e304a63cfc4 100644
--- a/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php
+++ b/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php
@@ -83,7 +83,10 @@ class RegistrationContextTest extends TestCase {
$this->context->delegateEventListenerRegistrations($dispatcher);
}
- public function testRegisterService(): void {
+ /**
+ * @dataProvider dataProvider_TrueFalse
+ */
+ public function testRegisterService(bool $shared): void {
$app = $this->createMock(App::class);
$service = 'abc';
$factory = function () {
@@ -94,11 +97,11 @@ class RegistrationContextTest extends TestCase {
->willReturn($container);
$container->expects($this->once())
->method('registerService')
- ->with($service, $factory, true);
+ ->with($service, $factory, $shared);
$this->logger->expects($this->never())
->method('logException');
- $this->context->for('myapp')->registerService($service, $factory);
+ $this->context->for('myapp')->registerService($service, $factory, $shared);
$this->context->delegateContainerRegistrations([
'myapp' => $app,
]);
@@ -159,4 +162,11 @@ class RegistrationContextTest extends TestCase {
'myapp' => $app,
]);
}
+
+ public function dataProvider_TrueFalse() {
+ return[
+ [true],
+ [false]
+ ];
+ }
}