diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 71ce9fb1..13098828 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -27,6 +27,6 @@ - + - \ No newline at end of file + diff --git a/src/App.php b/src/App.php index 95ded4c7..50b34b1a 100644 --- a/src/App.php +++ b/src/App.php @@ -117,6 +117,16 @@ public static function path(): string return self::$path; } + public static function isLocal(): bool + { + return Config::get('app.env') === 'local'; + } + + public static function isProduction(): bool + { + return Config::get('app.env') === 'production'; + } + public function swap(string $key, object $concrete): void { self::$container->extend($key)->setConcrete($concrete); diff --git a/tests/Unit/AppTest.php b/tests/Unit/AppTest.php new file mode 100644 index 00000000..0b6f4d82 --- /dev/null +++ b/tests/Unit/AppTest.php @@ -0,0 +1,10 @@ +toBeTrue(); + expect(App::isProduction())->toBeFalse(); +});