Page MenuHomeDevCentral

D459.diff
No OneTemporary

D459.diff

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

Mime Type
text/plain
Expires
Sat, Nov 16, 19:08 (13 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247969
Default Alt Text
D459.diff (2 KB)

Event Timeline