Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit 33a5150

Browse files
committed
Updated methods signature - all final, tests return void
1 parent cd4554d commit 33a5150

File tree

5 files changed

+39
-39
lines changed

5 files changed

+39
-39
lines changed

src/AliasTestTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
trait AliasTestTrait
1515
{
16-
public function alias() : Generator
16+
final public function alias() : Generator
1717
{
1818
yield 'alias-service' => [
1919
[
@@ -82,7 +82,7 @@ public function alias() : Generator
8282
/**
8383
* @dataProvider alias
8484
*/
85-
public function testRetrievingServiceByNameBeforeAliasOfServiceResultsInSameInstance(
85+
final public function testRetrievingServiceByNameBeforeAliasOfServiceResultsInSameInstance(
8686
array $config,
8787
string $serviceToTest
8888
) : void {
@@ -96,7 +96,7 @@ public function testRetrievingServiceByNameBeforeAliasOfServiceResultsInSameInst
9696
/**
9797
* @dataProvider alias
9898
*/
99-
public function testRetrievingAliasedServiceBeforeResolvedServiceResultsInSameInstance(
99+
final public function testRetrievingAliasedServiceBeforeResolvedServiceResultsInSameInstance(
100100
array $config,
101101
string $serviceToTest
102102
) : void {
@@ -107,7 +107,7 @@ public function testRetrievingAliasedServiceBeforeResolvedServiceResultsInSameIn
107107
self::assertSame($container->get('alias'), $container->get($serviceToTest));
108108
}
109109

110-
public function testInstancesRetrievedByTwoAliasesResolvingToSameServiceMustBeTheSame()
110+
final public function testInstancesRetrievedByTwoAliasesResolvingToSameServiceMustBeTheSame() : void
111111
{
112112
$container = $this->createContainer([
113113
'aliases' => [

src/DelegatorTestTrait.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
trait DelegatorTestTrait
1919
{
20-
public function testDelegatorsOperateOnInvokables() : void
20+
final public function testDelegatorsOperateOnInvokables() : void
2121
{
2222
$config = [
2323
'invokables' => [
@@ -41,7 +41,7 @@ public function testDelegatorsOperateOnInvokables() : void
4141
self::assertSame($instance, $container->get(TestAsset\Service::class));
4242
}
4343

44-
public function testDelegatorsDoNotOperateOnServices() : void
44+
final public function testDelegatorsDoNotOperateOnServices() : void
4545
{
4646
$myService = new TestAsset\Service();
4747
$config = [
@@ -63,7 +63,7 @@ public function testDelegatorsDoNotOperateOnServices() : void
6363
self::assertSame($myService, $instance);
6464
}
6565

66-
public function testDelegatorsApplyToInvokableServiceResolvedViaAlias() : void
66+
final public function testDelegatorsApplyToInvokableServiceResolvedViaAlias() : void
6767
{
6868
$config = [
6969
'aliases' => [
@@ -91,7 +91,7 @@ public function testDelegatorsApplyToInvokableServiceResolvedViaAlias() : void
9191
self::assertSame($instance, $container->get(TestAsset\Service::class));
9292
}
9393

94-
public function testDelegatorsNamedForAliasDoNotApplyToInvokableServiceResolvedViaAlias() : void
94+
final public function testDelegatorsNamedForAliasDoNotApplyToInvokableServiceResolvedViaAlias() : void
9595
{
9696
$config = [
9797
'aliases' => [
@@ -119,7 +119,7 @@ public function testDelegatorsNamedForAliasDoNotApplyToInvokableServiceResolvedV
119119
self::assertSame($instance, $container->get(TestAsset\Service::class));
120120
}
121121

122-
public function testDelegatorsNamedForAliasDoNotApplyToInvokableServiceWithAlias() : void
122+
final public function testDelegatorsNamedForAliasDoNotApplyToInvokableServiceWithAlias() : void
123123
{
124124
$config = [
125125
'invokables' => [
@@ -144,7 +144,7 @@ public function testDelegatorsNamedForAliasDoNotApplyToInvokableServiceWithAlias
144144
self::assertSame($instance, $container->get(TestAsset\Service::class));
145145
}
146146

147-
public function testDelegatorsDoNotApplyToAliasResolvingToServiceEntry() : void
147+
final public function testDelegatorsDoNotApplyToAliasResolvingToServiceEntry() : void
148148
{
149149
$myService = new TestAsset\Service();
150150
$config = [
@@ -176,7 +176,7 @@ public function testDelegatorsDoNotApplyToAliasResolvingToServiceEntry() : void
176176
self::assertSame($instance, $container->get('foo-bar'));
177177
}
178178

179-
public function testDelegatorsDoNotTriggerForAliasTargetingInvokableService() : void
179+
final public function testDelegatorsDoNotTriggerForAliasTargetingInvokableService() : void
180180
{
181181
$config = [
182182
'aliases' => [
@@ -204,7 +204,7 @@ public function testDelegatorsDoNotTriggerForAliasTargetingInvokableService() :
204204
self::assertSame($instance, $container->get(TestAsset\Service::class));
205205
}
206206

207-
public function delegatorService() : Generator
207+
final public function delegatorService() : Generator
208208
{
209209
yield 'invokable' => [
210210
[
@@ -249,7 +249,7 @@ public function delegatorService() : Generator
249249
/**
250250
* @dataProvider delegatorService
251251
*/
252-
public function testDelegatorsReceiveCallbackResolvingToReturnValueOfPrevious(
252+
final public function testDelegatorsReceiveCallbackResolvingToReturnValueOfPrevious(
253253
array $config,
254254
string $serviceNameToTest,
255255
string $delegatedServiceName
@@ -280,7 +280,7 @@ public function testDelegatorsReceiveCallbackResolvingToReturnValueOfPrevious(
280280
self::assertSame($instance, $container->get($serviceNameToTest));
281281
}
282282

283-
public function testMultipleAliasesForADelegatedInvokableServiceReceiveSameInstance()
283+
final public function testMultipleAliasesForADelegatedInvokableServiceReceiveSameInstance() : void
284284
{
285285
$container = $this->createContainer([
286286
'invokables' => [
@@ -317,7 +317,7 @@ public function testMultipleAliasesForADelegatedInvokableServiceReceiveSameInsta
317317
/**
318318
* @dataProvider delegatorService
319319
*/
320-
public function testNonInvokableDelegatorClassNameResultsInExceptionDuringInstanceRetrieval(
320+
final public function testNonInvokableDelegatorClassNameResultsInExceptionDuringInstanceRetrieval(
321321
array $config,
322322
string $serviceNameToTest,
323323
string $delegatedServiceName
@@ -338,7 +338,7 @@ public function testNonInvokableDelegatorClassNameResultsInExceptionDuringInstan
338338
/**
339339
* @dataProvider delegatorService
340340
*/
341-
public function testNonExistentDelegatorClassResultsInExceptionDuringInstanceRetrieval(
341+
final public function testNonExistentDelegatorClassResultsInExceptionDuringInstanceRetrieval(
342342
array $config,
343343
string $serviceNameToTest,
344344
string $delegatedServiceName
@@ -359,7 +359,7 @@ public function testNonExistentDelegatorClassResultsInExceptionDuringInstanceRet
359359
/**
360360
* @dataProvider delegatorService
361361
*/
362-
public function testDelegatorClassNameRequiringConstructorArgumentsResultsInExceptionDuringInstanceRetrieval(
362+
final public function testDelegatorClassNameRequiringConstructorArgumentsResultsInExceptionDuringInstanceRetrieval(
363363
array $config,
364364
string $serviceNameToTest,
365365
string $delegatedServiceName
@@ -382,7 +382,7 @@ function () use ($container, $serviceNameToTest) {
382382
);
383383
}
384384

385-
public function factoriesForDelegators() : Generator
385+
final public function factoriesForDelegators() : Generator
386386
{
387387
yield 'function-name' => [['factories' => ['service' => __NAMESPACE__ . '\TestAsset\factory']]];
388388
yield 'invokable-class-name' => [['factories' => ['service' => TestAsset\Factory::class]]];
@@ -403,7 +403,7 @@ public function factoriesForDelegators() : Generator
403403
/**
404404
* @dataProvider factoriesForDelegators
405405
*/
406-
public function testDelegatorFactoriesTriggerForFactoryBackedServicesUsingAnyFactoryType(array $config)
406+
final public function testDelegatorFactoriesTriggerForFactoryBackedServicesUsingAnyFactoryType(array $config) : void
407407
{
408408
$config += [
409409
'delegators' => [
@@ -427,7 +427,7 @@ public function testDelegatorFactoriesTriggerForFactoryBackedServicesUsingAnyFac
427427
/**
428428
* @dataProvider factoriesForDelegators
429429
*/
430-
public function testDelegatorsTriggerForFactoryServiceResolvedByAlias(array $config) : void
430+
final public function testDelegatorsTriggerForFactoryServiceResolvedByAlias(array $config) : void
431431
{
432432
$config += [
433433
'aliases' => [
@@ -459,7 +459,7 @@ public function testDelegatorsTriggerForFactoryServiceResolvedByAlias(array $con
459459
/**
460460
* @dataProvider factoriesForDelegators
461461
*/
462-
public function testDelegatorsDoNotTriggerForAliasTargetingFactoryBasedServiceUsingAnyFactoryType(
462+
final public function testDelegatorsDoNotTriggerForAliasTargetingFactoryBasedServiceUsingAnyFactoryType(
463463
array $config
464464
) : void {
465465
$config += [
@@ -485,7 +485,7 @@ public function testDelegatorsDoNotTriggerForAliasTargetingFactoryBasedServiceUs
485485
self::assertSame($instance, $container->get('service'));
486486
}
487487

488-
public function invalidService()
488+
final public function invalidService()
489489
{
490490
yield 'non-existent-invokable' => [
491491
['invokables' => [TestAsset\NonExistent::class]],
@@ -560,7 +560,7 @@ public function invalidService()
560560
/**
561561
* @dataProvider invalidService
562562
*/
563-
public function testWithDelegatorsResolvesToInvalidClassNoExceptionIsRaisedIfCallbackNeverInvoked(
563+
final public function testWithDelegatorsResolvesToInvalidClassNoExceptionIsRaisedIfCallbackNeverInvoked(
564564
array $config,
565565
string $serviceNameToTest,
566566
string $delegatedServiceName
@@ -581,7 +581,7 @@ public function testWithDelegatorsResolvesToInvalidClassNoExceptionIsRaisedIfCal
581581
/**
582582
* @dataProvider invalidService
583583
*/
584-
public function testWithDelegatorsResolvesToInvalidClassAnExceptionIsRaisedWhenCallbackIsInvoked(
584+
final public function testWithDelegatorsResolvesToInvalidClassAnExceptionIsRaisedWhenCallbackIsInvoked(
585585
array $config,
586586
string $serviceNameToTest,
587587
string $delegatedServiceName

src/FactoryTestTrait.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
trait FactoryTestTrait
1919
{
20-
public function factory() : Generator
20+
final public function factory() : Generator
2121
{
2222
yield 'function-name' => [['factories' => ['service' => __NAMESPACE__ . '\TestAsset\factory']]];
2323
yield 'invokable-class-name' => [['factories' => ['service' => TestAsset\Factory::class]]];
@@ -38,7 +38,7 @@ public function factory() : Generator
3838
/**
3939
* @dataProvider factory
4040
*/
41-
public function testFactoryIsUsedToProduceService(array $config) : void
41+
final public function testFactoryIsUsedToProduceService(array $config) : void
4242
{
4343
$container = $this->createContainer($config);
4444

@@ -48,7 +48,7 @@ public function testFactoryIsUsedToProduceService(array $config) : void
4848
self::assertSame($service, $container->get('service'));
4949
}
5050

51-
public function factoryWithName() : Generator
51+
final public function factoryWithName() : Generator
5252
{
5353
yield 'function-name' => [['factories' => ['service' => __NAMESPACE__ . '\TestAsset\factoryWithName']]];
5454
yield 'invokable-class-name' => [['factories' => ['service' => TestAsset\FactoryWithName::class]]];
@@ -69,7 +69,7 @@ public function factoryWithName() : Generator
6969
/**
7070
* @dataProvider factoryWithName
7171
*/
72-
public function testFactoryIsProvidedContainerAndServiceNameAsArguments(array $config) : void
72+
final public function testFactoryIsProvidedContainerAndServiceNameAsArguments(array $config) : void
7373
{
7474
$container = $this->createContainer($config);
7575

@@ -81,7 +81,7 @@ public function testFactoryIsProvidedContainerAndServiceNameAsArguments(array $c
8181
self::assertEquals('service', array_shift($args));
8282
}
8383

84-
public function testFactoryReferencingAServiceWillResultInExceptionDuringRetrieval() : void
84+
final public function testFactoryReferencingAServiceWillResultInExceptionDuringRetrieval() : void
8585
{
8686
$container = $this->createContainer([
8787
'factories' => ['service' => 'factory'],
@@ -94,7 +94,7 @@ public function testFactoryReferencingAServiceWillResultInExceptionDuringRetriev
9494
$container->get('service');
9595
}
9696

97-
public function testNonInvokableFactoryClassNameResultsInExceptionDuringInstanceRetrieval()
97+
final public function testNonInvokableFactoryClassNameResultsInExceptionDuringInstanceRetrieval() : void
9898
{
9999
$container = $this->createContainer([
100100
'factories' => [
@@ -107,7 +107,7 @@ public function testNonInvokableFactoryClassNameResultsInExceptionDuringInstance
107107
$container->get('service');
108108
}
109109

110-
public function testNonExistentFactoryClassResultsInExceptionDuringInstanceRetrieval()
110+
final public function testNonExistentFactoryClassResultsInExceptionDuringInstanceRetrieval() : void
111111
{
112112
$container = $this->createContainer([
113113
'factories' => [
@@ -120,7 +120,7 @@ public function testNonExistentFactoryClassResultsInExceptionDuringInstanceRetri
120120
$container->get('service');
121121
}
122122

123-
public function testFactoryClassNameRequiringConstructorArgumentsResultsInExceptionDuringInstanceRetrieval()
123+
final public function testFactoryConstructorRequiringArgumentsResultsInExceptionDuringInstanceRetrieval() : void
124124
{
125125
$container = $this->createContainer([
126126
'factories' => [

src/InvokableTestTrait.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
trait InvokableTestTrait
1717
{
18-
public function testCanSpecifyInvokableWithoutKey() : void
18+
final public function testCanSpecifyInvokableWithoutKey() : void
1919
{
2020
$config = [
2121
'invokables' => [
@@ -30,7 +30,7 @@ public function testCanSpecifyInvokableWithoutKey() : void
3030
self::assertInstanceOf(TestAsset\Service::class, $service);
3131
}
3232

33-
public function testCanSpecifyMultipleInvokablesWithoutKeyAndNotCauseCollisions() : void
33+
final public function testCanSpecifyMultipleInvokablesWithoutKeyAndNotCauseCollisions() : void
3434
{
3535
$config = [
3636
'invokables' => [
@@ -51,7 +51,7 @@ public function testCanSpecifyMultipleInvokablesWithoutKeyAndNotCauseCollisions(
5151
self::assertInstanceOf(TestAsset\DelegatorFactory::class, $instance);
5252
}
5353

54-
public function testCanFetchInvokableByClassName() : void
54+
final public function testCanFetchInvokableByClassName() : void
5555
{
5656
$config = [
5757
'invokables' => [
@@ -66,7 +66,7 @@ public function testCanFetchInvokableByClassName() : void
6666
self::assertInstanceOf(TestAsset\Service::class, $service);
6767
}
6868

69-
public function testCanFetchInvokableByBothAliasAndClassName() : void
69+
final public function testCanFetchInvokableByBothAliasAndClassName() : void
7070
{
7171
$config = [
7272
'invokables' => [
@@ -86,7 +86,7 @@ public function testCanFetchInvokableByBothAliasAndClassName() : void
8686
self::assertSame($originService, $container->get(TestAsset\Service::class));
8787
}
8888

89-
public function testFetchingInvokableThatHasRequiredConstructorParametersResultsInException()
89+
final public function testFetchingInvokableThatHasRequiredConstructorParametersResultsInException() : void
9090
{
9191
$config = [
9292
'invokables' => [
@@ -106,7 +106,7 @@ function () use ($container) {
106106
);
107107
}
108108

109-
public function testFetchingInvalidInvokableServiceByAliasResultsInException()
109+
final public function testFetchingInvalidInvokableServiceByAliasResultsInException()
110110
{
111111
$config = [
112112
'invokables' => [

src/ServiceTestTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
trait ServiceTestTrait
1313
{
14-
public function testFetchingServiceReturnsSameInstance() : void
14+
final public function testFetchingServiceReturnsSameInstance() : void
1515
{
1616
$service = new TestAsset\Service();
1717
$config = [

0 commit comments

Comments
 (0)