From 06895ef8cc3c227aec4e59a3bfca87430fd55c75 Mon Sep 17 00:00:00 2001 From: Robin Windey Date: Mon, 12 Oct 2020 14:19:41 +0200 Subject: [PATCH 1/2] Fix typo 'shared' --- .../Bootstrap/RegistrationContext.php | 2 +- .../Bootstrap/RegistrationContextTest.php | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 1ed2dac4c4565..e6512a55e17de 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -193,7 +193,7 @@ public function registerService(string $appId, string $name, callable $factory, "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 8441b6e983d8a..8e88db6f19a86 100644 --- a/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php +++ b/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php @@ -83,7 +83,10 @@ public function testRegisterEventListener(): void { $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 @@ public function testRegisterService(): void { ->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 @@ public function testRegisterMiddleware(): void { 'myapp' => $app, ]); } + + public function dataProvider_TrueFalse(){ + return[ + [true], + [false] + ]; + } } From a7ff7c47ab5e804d83954a6339109b2f74ec039a Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 12 Oct 2020 14:54:51 +0200 Subject: [PATCH 2/2] Fix code style Signed-off-by: Morris Jobke --- tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php b/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php index 8e88db6f19a86..e304a63cfc48f 100644 --- a/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php +++ b/tests/lib/AppFramework/Bootstrap/RegistrationContextTest.php @@ -163,7 +163,7 @@ public function testRegisterMiddleware(): void { ]); } - public function dataProvider_TrueFalse(){ + public function dataProvider_TrueFalse() { return[ [true], [false]