Fix typo 'shared'

This commit is contained in:
Robin Windey 2020-10-12 14:19:41 +02:00 committed by backportbot[bot]
parent 830d911507
commit 06895ef8cc
2 changed files with 14 additions and 4 deletions

View File

@ -193,7 +193,7 @@ class RegistrationContext {
"appId" => $appId, "appId" => $appId,
"name" => $name, "name" => $name,
"factory" => $factory, "factory" => $factory,
"sharred" => $shared, "shared" => $shared,
]; ];
} }

View File

@ -83,7 +83,10 @@ class RegistrationContextTest extends TestCase {
$this->context->delegateEventListenerRegistrations($dispatcher); $this->context->delegateEventListenerRegistrations($dispatcher);
} }
public function testRegisterService(): void { /**
* @dataProvider dataProvider_TrueFalse
*/
public function testRegisterService(bool $shared): void {
$app = $this->createMock(App::class); $app = $this->createMock(App::class);
$service = 'abc'; $service = 'abc';
$factory = function () { $factory = function () {
@ -94,11 +97,11 @@ class RegistrationContextTest extends TestCase {
->willReturn($container); ->willReturn($container);
$container->expects($this->once()) $container->expects($this->once())
->method('registerService') ->method('registerService')
->with($service, $factory, true); ->with($service, $factory, $shared);
$this->logger->expects($this->never()) $this->logger->expects($this->never())
->method('logException'); ->method('logException');
$this->context->for('myapp')->registerService($service, $factory); $this->context->for('myapp')->registerService($service, $factory, $shared);
$this->context->delegateContainerRegistrations([ $this->context->delegateContainerRegistrations([
'myapp' => $app, 'myapp' => $app,
]); ]);
@ -159,4 +162,11 @@ class RegistrationContextTest extends TestCase {
'myapp' => $app, 'myapp' => $app,
]); ]);
} }
public function dataProvider_TrueFalse(){
return[
[true],
[false]
];
}
} }