Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3747951
D459.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D459.diff
View Options
diff --git a/app/Helpers/.gitkeep b/app/Helpers/.gitkeep
new file mode 100644
diff --git a/app/Providers/HelpersServiceProvider.php b/app/Providers/HelpersServiceProvider.php
new file mode 100644
--- /dev/null
+++ b/app/Providers/HelpersServiceProvider.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace AuthGrove\Providers;
+
+use Illuminate\Support\ServiceProvider;
+
+class HelpersServiceProvider extends ServiceProvider {
+
+ /**
+ * Bootstraps the application services.
+ *
+ * @return void
+ */
+ public function boot() {
+ //
+ }
+
+ /**
+ * Registers the application services.
+ *
+ * @return void
+ */
+ public function register() {
+ }
+
+}
diff --git a/config/app.php b/config/app.php
--- a/config/app.php
+++ b/config/app.php
@@ -180,6 +180,7 @@
AuthGrove\Providers\AppServiceProvider::class,
AuthGrove\Providers\AuthServiceProvider::class,
AuthGrove\Providers\EventServiceProvider::class,
+ AuthGrove\Providers\HelpersServiceProvider::class,
AuthGrove\Providers\RouteServiceProvider::class,
],
diff --git a/tests/Providers/HelpersServiceProviderTest.php b/tests/Providers/HelpersServiceProviderTest.php
new file mode 100644
--- /dev/null
+++ b/tests/Providers/HelpersServiceProviderTest.php
@@ -0,0 +1,27 @@
+<?php
+
+class HelpersServiceProviderTest extends TestCase {
+
+ ///
+ /// Tests specific to this service provider
+ ///
+
+ public function testOmittedFiles () {
+ // Gets files in the folder
+ $files = File::allFiles(app_path('Helpers'));
+ array_walk($files, function (&$item) {
+ $item = (string)$item; }
+ );
+
+ // Asserts each of these file are well included, if not provide an hint
+ // to solve the issue.
+ $this->assertArrayContainsArrayItems(
+ $files,
+ get_included_files(),
+ "Files in the helpers/ folder are intended to be required in the "
+ . "HelpersServiceProvider::register method. "
+ . "Edit app/Providers/HelpersServiceProvider.php to fix the issue."
+ );
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 05:42 (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247969
Default Alt Text
D459.diff (2 KB)
Attached To
Mode
D459: Service provider for helper global functions
Attached
Detach File
Event Timeline
Log In to Comment