88use Laminas \Diactoros \RequestFactory ;
99use Laminas \Diactoros \StreamFactory ;
1010use Laminas \Diactoros \UriFactory ;
11+ use ListInterop \ConvertKit \Client as ConvertKitClient ;
1112use ListInterop \ConvertKit \Container \ClientFactory ;
1213use ListInterop \ConvertKit \Exception \AssertionFailed ;
1314use PHPUnit \Framework \MockObject \MockObject ;
@@ -32,7 +33,7 @@ protected function setUp(): void
3233 }
3334
3435 /** @return array<string, array{0: bool, 1: mixed, 2: string}> */
35- public function erroneousConfig (): array
36+ public static function erroneousConfig (): array
3637 {
3738 return [
3839 'No Config ' => [
@@ -108,7 +109,7 @@ public function testThatTheContainerMustHaveConfiguration(bool $has, mixed $get,
108109
109110 $ this ->expectException (AssertionFailed::class);
110111 $ this ->expectExceptionMessage ($ expectedErrorMessage );
111- ( $ this ->factory ) ($ this ->container );
112+ $ this ->factory -> __invoke ($ this ->container );
112113 }
113114
114115 public function testClientCreationWillProceedWhenTheContainerHasAllRequiredDependencies (): void
@@ -127,7 +128,8 @@ public function testClientCreationWillProceedWhenTheContainerHasAllRequiredDepen
127128 [StreamFactoryInterface::class, new StreamFactory ()],
128129 ]);
129130
130- ($ this ->factory )($ this ->container );
131+ $ client = $ this ->factory ->__invoke ($ this ->container );
132+ self ::assertInstanceOf (ConvertKitClient::class, $ client );
131133 }
132134
133135 public function testClientCreationWillProceedWhenOnlyConfigIsAvailable (): void
@@ -145,7 +147,7 @@ public function testClientCreationWillProceedWhenOnlyConfigIsAvailable(): void
145147 ->method ('get ' )
146148 ->willReturn (['convertkit ' => ['api-key ' => 'foo ' , 'secret-key ' => 'bar ' ]]);
147149
148- ( $ this ->factory ) ($ this ->container );
150+ $ this ->factory -> __invoke ($ this ->container );
149151 }
150152
151153 public function testAnAssertionErrorWillBeThrownWhenTheContainerSendsSomethingWeird (): void
@@ -162,6 +164,6 @@ public function testAnAssertionErrorWillBeThrownWhenTheContainerSendsSomethingWe
162164 ]);
163165
164166 $ this ->expectException (AssertionFailed::class);
165- ( $ this ->factory ) ($ this ->container );
167+ $ this ->factory -> __invoke ($ this ->container );
166168 }
167169}
0 commit comments