File tree Expand file tree Collapse file tree
src/Illuminate/Foundation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1102,6 +1102,17 @@ public function getLoadedProviders()
11021102 return $ this ->loadedProviders ;
11031103 }
11041104
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+
11051116 /**
11061117 * Get the application's deferred services.
11071118 *
@@ -1292,26 +1303,4 @@ public function getNamespace()
12921303
12931304 throw new RuntimeException ('Unable to detect application namespace. ' );
12941305 }
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- }
13171306}
Original file line number Diff line number Diff line change @@ -95,20 +95,8 @@ public function testServiceProvidersCouldBeLoaded()
9595 $ app = new Application ;
9696 $ app ->register ($ provider );
9797
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));
112100 }
113101
114102 public function testDeferredServicesMarkedAsBound ()
You can’t perform that action at this time.
0 commit comments