@@ -57,7 +57,7 @@ public function testInjectCreationContextInFactories()
57
57
58
58
$ object = $ pluginManager ->get (InvokableObject::class);
59
59
60
- $ this -> assertInstanceOf (InvokableObject::class, $ object );
60
+ self :: assertInstanceOf (InvokableObject::class, $ object );
61
61
}
62
62
63
63
public function testValidateInstance ()
@@ -95,9 +95,9 @@ public function testCachesInstanceByDefaultIfNoOptionsArePassed()
95
95
96
96
$ first = $ pluginManager ->get (InvokableObject::class);
97
97
$ second = $ pluginManager ->get (InvokableObject::class);
98
- $ this -> assertInstanceOf (InvokableObject::class, $ first );
99
- $ this -> assertInstanceOf (InvokableObject::class, $ second );
100
- $ this -> assertSame ($ first , $ second );
98
+ self :: assertInstanceOf (InvokableObject::class, $ first );
99
+ self :: assertInstanceOf (InvokableObject::class, $ second );
100
+ self :: assertSame ($ first , $ second );
101
101
}
102
102
103
103
public function shareByDefaultSettings ()
@@ -127,9 +127,9 @@ public function testReturnsDiscreteInstancesIfOptionsAreProvidedRegardlessOfShar
127
127
128
128
$ first = $ pluginManager ->get (InvokableObject::class, $ options );
129
129
$ second = $ pluginManager ->get (InvokableObject::class, $ options );
130
- $ this -> assertInstanceOf (InvokableObject::class, $ first );
131
- $ this -> assertInstanceOf (InvokableObject::class, $ second );
132
- $ this -> assertNotSame ($ first , $ second );
130
+ self :: assertInstanceOf (InvokableObject::class, $ first );
131
+ self :: assertInstanceOf (InvokableObject::class, $ second );
132
+ self :: assertNotSame ($ first , $ second );
133
133
}
134
134
135
135
/**
@@ -164,13 +164,13 @@ function ($container, $name, $callback) {
164
164
]);
165
165
166
166
$ instance = $ pluginManager ->get (stdClass::class);
167
- $ this -> assertTrue (isset ($ instance ->option ), 'Delegator-injected option was not found ' );
168
- $ this -> assertEquals (
167
+ self :: assertTrue (isset ($ instance ->option ), 'Delegator-injected option was not found ' );
168
+ self :: assertEquals (
169
169
$ config ['option ' ],
170
170
$ instance ->option ,
171
171
'Delegator-injected option does not match configuration '
172
172
);
173
- $ this -> assertEquals ('bar ' , $ instance ->foo );
173
+ self :: assertEquals ('bar ' , $ instance ->foo );
174
174
}
175
175
176
176
/**
@@ -192,21 +192,21 @@ public function testGetRaisesExceptionWhenNoFactoryIsResolved()
192
192
public function testCallingSetServiceLocatorSetsCreationContextWithDeprecationNotice ()
193
193
{
194
194
set_error_handler (function ($ errno , $ errstr ) {
195
- $ this -> assertEquals (E_USER_DEPRECATED , $ errno );
195
+ self :: assertEquals (E_USER_DEPRECATED , $ errno );
196
196
}, E_USER_DEPRECATED );
197
197
$ pluginManager = new TestAsset \LenientPluginManager ();
198
198
restore_error_handler ();
199
199
200
- $ this -> assertAttributeSame ($ pluginManager , 'creationContext ' , $ pluginManager );
200
+ self :: assertAttributeSame ($ pluginManager , 'creationContext ' , $ pluginManager );
201
201
$ serviceManager = new ServiceManager ();
202
202
203
203
set_error_handler (function ($ errno , $ errstr ) {
204
- $ this -> assertEquals (E_USER_DEPRECATED , $ errno );
204
+ self :: assertEquals (E_USER_DEPRECATED , $ errno );
205
205
}, E_USER_DEPRECATED );
206
206
$ pluginManager ->setServiceLocator ($ serviceManager );
207
207
restore_error_handler ();
208
208
209
- $ this -> assertAttributeSame ($ serviceManager , 'creationContext ' , $ pluginManager );
209
+ self :: assertAttributeSame ($ serviceManager , 'creationContext ' , $ pluginManager );
210
210
}
211
211
212
212
/**
@@ -215,11 +215,11 @@ public function testCallingSetServiceLocatorSetsCreationContextWithDeprecationNo
215
215
public function testPassingNoInitialConstructorArgumentSetsPluginManagerAsCreationContextWithDeprecationNotice ()
216
216
{
217
217
set_error_handler (function ($ errno , $ errstr ) {
218
- $ this -> assertEquals (E_USER_DEPRECATED , $ errno );
218
+ self :: assertEquals (E_USER_DEPRECATED , $ errno );
219
219
}, E_USER_DEPRECATED );
220
220
$ pluginManager = new TestAsset \LenientPluginManager ();
221
221
restore_error_handler ();
222
- $ this -> assertAttributeSame ($ pluginManager , 'creationContext ' , $ pluginManager );
222
+ self :: assertAttributeSame ($ pluginManager , 'creationContext ' , $ pluginManager );
223
223
}
224
224
225
225
/**
@@ -231,12 +231,12 @@ public function testCanPassConfigInterfaceAsFirstConstructorArgumentWithDeprecat
231
231
$ config ->toArray ()->willReturn ([]);
232
232
233
233
set_error_handler (function ($ errno , $ errstr ) {
234
- $ this -> assertEquals (E_USER_DEPRECATED , $ errno );
234
+ self :: assertEquals (E_USER_DEPRECATED , $ errno );
235
235
}, E_USER_DEPRECATED );
236
236
$ pluginManager = new TestAsset \LenientPluginManager ($ config ->reveal ());
237
237
restore_error_handler ();
238
238
239
- $ this -> assertAttributeSame ($ pluginManager , 'creationContext ' , $ pluginManager );
239
+ self :: assertAttributeSame ($ pluginManager , 'creationContext ' , $ pluginManager );
240
240
}
241
241
242
242
public function invalidConstructorArguments ()
@@ -273,12 +273,12 @@ public function testPassingConfigInstanceAsFirstConstructorArgumentSkipsSecondAr
273
273
$ config ->toArray ()->willReturn (['services ' => [__CLASS__ => $ this ]]);
274
274
275
275
set_error_handler (function ($ errno , $ errstr ) {
276
- $ this -> assertEquals (E_USER_DEPRECATED , $ errno );
276
+ self :: assertEquals (E_USER_DEPRECATED , $ errno );
277
277
}, E_USER_DEPRECATED );
278
278
$ pluginManager = new TestAsset \LenientPluginManager ($ config ->reveal (), ['services ' => [__CLASS__ => []]]);
279
279
restore_error_handler ();
280
280
281
- $ this -> assertSame ($ this , $ pluginManager ->get (__CLASS__ ));
281
+ self :: assertSame ($ this , $ pluginManager ->get (__CLASS__ ));
282
282
}
283
283
284
284
/**
@@ -288,7 +288,7 @@ public function testPassingConfigInstanceAsFirstConstructorArgumentSkipsSecondAr
288
288
public function testAutoInvokableServicesAreNotKnownBeforeRetrieval ()
289
289
{
290
290
$ pluginManager = new TestAsset \SimplePluginManager (new ServiceManager ());
291
- $ this -> assertFalse ($ pluginManager ->has (TestAsset \InvokableObject::class));
291
+ self :: assertFalse ($ pluginManager ->has (TestAsset \InvokableObject::class));
292
292
}
293
293
294
294
/**
@@ -299,7 +299,7 @@ public function testSupportsRetrievingAutoInvokableServicesByDefault()
299
299
{
300
300
$ pluginManager = new TestAsset \SimplePluginManager (new ServiceManager ());
301
301
$ invokable = $ pluginManager ->get (TestAsset \InvokableObject::class);
302
- $ this -> assertInstanceOf (TestAsset \InvokableObject::class, $ invokable );
302
+ self :: assertInstanceOf (TestAsset \InvokableObject::class, $ invokable );
303
303
}
304
304
305
305
/**
@@ -322,23 +322,23 @@ public function testValidateWillFallBackToValidatePluginWhenDefinedAndEmitDeprec
322
322
$ assertionCalled = false ;
323
323
$ instance = (object ) [];
324
324
$ assertion = function ($ plugin ) use ($ instance , &$ assertionCalled ) {
325
- $ this -> assertSame ($ instance , $ plugin );
325
+ self :: assertSame ($ instance , $ plugin );
326
326
$ assertionCalled = true ;
327
327
};
328
328
$ pluginManager = new TestAsset \V2ValidationPluginManager (new ServiceManager ());
329
329
$ pluginManager ->assertion = $ assertion ;
330
330
331
331
$ errorHandlerCalled = false ;
332
332
set_error_handler (function ($ errno , $ errmsg ) use (&$ errorHandlerCalled ) {
333
- $ this -> assertEquals (E_USER_DEPRECATED , $ errno );
334
- $ this -> assertContains ('3.0 ' , $ errmsg );
333
+ self :: assertEquals (E_USER_DEPRECATED , $ errno );
334
+ self :: assertContains ('3.0 ' , $ errmsg );
335
335
$ errorHandlerCalled = true ;
336
336
}, E_USER_DEPRECATED );
337
337
$ pluginManager ->validate ($ instance );
338
338
restore_error_handler ();
339
339
340
- $ this -> assertTrue ($ assertionCalled , 'Assertion was not called by validatePlugin! ' );
341
- $ this -> assertTrue ($ errorHandlerCalled , 'Error handler was not triggered by validatePlugin! ' );
340
+ self :: assertTrue ($ assertionCalled , 'Assertion was not called by validatePlugin! ' );
341
+ self :: assertTrue ($ errorHandlerCalled , 'Error handler was not triggered by validatePlugin! ' );
342
342
}
343
343
344
344
public function testSetServiceShouldRaiseExceptionForInvalidPlugin ()
@@ -371,12 +371,12 @@ public function testAbstractFactoryGetsCreationContext()
371
371
$ abstractFactory ->__invoke ($ serviceManager , 'foo ' , null )
372
372
->willReturn (new InvokableObject ());
373
373
$ pluginManager ->addAbstractFactory ($ abstractFactory ->reveal ());
374
- $ this -> assertInstanceOf (InvokableObject::class, $ pluginManager ->get ('foo ' ));
374
+ self :: assertInstanceOf (InvokableObject::class, $ pluginManager ->get ('foo ' ));
375
375
}
376
376
377
377
public function testAliasPropertyResolves ()
378
378
{
379
379
$ pluginManager = new V2v3PluginManager (new ServiceManager ());
380
- $ this -> assertInstanceOf (InvokableObject::class, $ pluginManager ->get ('foo ' ));
380
+ self :: assertInstanceOf (InvokableObject::class, $ pluginManager ->get ('foo ' ));
381
381
}
382
382
}
0 commit comments