diff --git a/.gitignore b/.gitignore index a000285..23d8b14 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ composer.phar composer.lock -.idea/ \ No newline at end of file +.idea/ + +.phpunit.result.cache \ No newline at end of file diff --git a/composer.json b/composer.json index 4ae30b0..8286261 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,20 @@ "illuminate/console": "^6.0", "ext-json": "*" }, + "require-dev": { + "phpunit/phpunit": "^8.3", + "orchestra/testbench": "^4.0" + }, "autoload": { "psr-4": { "ProcyonWeb\\TranslationGenerator\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "ProcyonWeb\\TranslationGenerator\\Test\\": "tests/" + } + }, "extra": { "laravel": { "providers": [ diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..df759d5 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,22 @@ + + + + + tests + + + + + src/ + + + \ No newline at end of file diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 976be15..739f716 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -11,6 +11,11 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider */ public function register() { + $this->mergeConfigFrom( + __DIR__.'/../config/translation.php', + 'laravel_translation_generator' + ); + if ($this->app->runningInConsole()) { $this->commands([ GenerateCommand::class, @@ -29,6 +34,6 @@ public function boot() { $this->publishes([ __DIR__.'/../config/translation.php' => config_path('translation.php'), - ]); + ], 'laravel_translation_generator-config'); } } \ No newline at end of file diff --git a/tests/ShowFilesCommandTest.php b/tests/ShowFilesCommandTest.php new file mode 100644 index 0000000..20ea066 --- /dev/null +++ b/tests/ShowFilesCommandTest.php @@ -0,0 +1,14 @@ + []]); + + $this->artisan('translation:show-files') + ->assertExitCode(0); + } +} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..ec86e97 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,20 @@ +