File tree 2 files changed +13
-36
lines changed
src/Illuminate/Foundation
2 files changed +13
-36
lines changed Original file line number Diff line number Diff line change @@ -1102,6 +1102,17 @@ public function getLoadedProviders()
1102
1102
return $ this ->loadedProviders ;
1103
1103
}
1104
1104
1105
+ /**
1106
+ * Determine if the given service provider is loaded.
1107
+ *
1108
+ * @param string $provider
1109
+ * @return bool
1110
+ */
1111
+ public function providerIsLoaded (string $ provider )
1112
+ {
1113
+ return isset ($ this ->loadedProviders [$ provider ]);
1114
+ }
1115
+
1105
1116
/**
1106
1117
* Get the application's deferred services.
1107
1118
*
@@ -1292,26 +1303,4 @@ public function getNamespace()
1292
1303
1293
1304
throw new RuntimeException ('Unable to detect application namespace. ' );
1294
1305
}
1295
-
1296
- /**
1297
- * Determine if service provider is loaded.
1298
- *
1299
- * @param string $provider
1300
- * @return bool
1301
- */
1302
- public function isProviderLoaded (string $ provider ): bool
1303
- {
1304
- return isset ($ this ->loadedProviders [$ provider ]);
1305
- }
1306
-
1307
- /**
1308
- * Determine if service provider is not loaded.
1309
- *
1310
- * @param string $provider
1311
- * @return bool
1312
- */
1313
- public function isProviderNotLoaded (string $ provider ): bool
1314
- {
1315
- return ! $ this ->isProviderLoaded ($ provider );
1316
- }
1317
1306
}
Original file line number Diff line number Diff line change @@ -95,20 +95,8 @@ public function testServiceProvidersCouldBeLoaded()
95
95
$ app = new Application ;
96
96
$ app ->register ($ provider );
97
97
98
- $ this ->assertTrue ($ app ->isProviderLoaded ($ class ));
99
- $ this ->assertFalse ($ app ->isProviderLoaded (ApplicationBasicServiceProviderStub::class));
100
- }
101
-
102
- public function testServiceProvidersCouldBeNotLoaded ()
103
- {
104
- $ provider = m::mock (ServiceProvider::class);
105
- $ class = get_class ($ provider );
106
- $ provider ->shouldReceive ('register ' )->once ();
107
- $ app = new Application ;
108
- $ app ->register ($ provider );
109
-
110
- $ this ->assertTrue ($ app ->isProviderNotLoaded (ApplicationBasicServiceProviderStub::class));
111
- $ this ->assertFalse ($ app ->isProviderNotLoaded ($ class ));
98
+ $ this ->assertTrue ($ app ->providerIsLoaded ($ class ));
99
+ $ this ->assertFalse ($ app ->providerIsLoaded (ApplicationBasicServiceProviderStub::class));
112
100
}
113
101
114
102
public function testDeferredServicesMarkedAsBound ()
You can’t perform that action at this time.
0 commit comments