From 29f69482b8042f567244f8394ddbba414f16abc8 Mon Sep 17 00:00:00 2001 From: edalzell Date: Tue, 18 Apr 2023 15:40:53 -0700 Subject: [PATCH] get tests going again --- src/ServiceProvider.php | 11 +++++++++++ tests/TestCase.php | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 83c4ccf..bf9e808 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -14,4 +14,15 @@ class ServiceProvider extends AddonServiceProvider protected $fieldtypes = [ Tag::class, ]; + + public function bootAddon() + { + // needed for testing but not production + if (app()->environment('testing')) { + $this->loadViewsFrom( + __DIR__.'/../resources/views', + 'uptime' + ); + } + } } diff --git a/tests/TestCase.php b/tests/TestCase.php index cb6b1c3..7114c3d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -45,7 +45,7 @@ protected function getEnvironmentSetUp($app) $app->make(Manifest::class)->manifest = [ 'transformstudios/uptime' => [ 'id' => 'transformstudios/uptime', - 'namespace' => 'TransformStudios\\Uptime\\', + 'namespace' => 'TransformStudios\\Uptime', ], ]; } @@ -57,7 +57,7 @@ protected function resolveApplicationConfiguration($app) $configs = ['assets', 'cp', 'forms', 'routes', 'static_caching', 'sites', 'stache', 'system', 'users']; foreach ($configs as $config) { - $app['config']->set("statamic.$config", require __DIR__ . "/../vendor/statamic/cms/config/{$config}.php"); + $app['config']->set("statamic.$config", require __DIR__."/../vendor/statamic/cms/config/{$config}.php"); } // Setting the user repository to the default flat file system