Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Buijsrogge committed May 12, 2018
2 parents cb86856 + 32b4eca commit 9ac1f3c
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"illuminate/database": "~5.4.0|~5.5.0|~5.6.0"
},
"require-dev": {
"mockery/mockery": "^1.1",
"orchestra/testbench": "~3.3.0|~3.4.2|^3.5.0",
"phpunit/phpunit": "^5.7|6.2|^7.0",
"vlucas/phpdotenv": "^2.4"
Expand Down
116 changes: 115 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/Commands/SynchroniseTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use SeBuDesign\PoEditor\Events\TranslationsSynchronized;
use SeBuDesign\PoEditor\PoEditor;

class SynchroniseTranslations extends Command
Expand Down Expand Up @@ -47,6 +48,9 @@ public function handle()
$locales
);

// Create an event to clear translations cache or something else
event(new TranslationsSynchronized());

$this->info("Translations synchronised");
}

Expand Down
5 changes: 5 additions & 0 deletions src/Events/TranslationsSynchronized.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

namespace SeBuDesign\PoEditor\Events;

class TranslationsSynchronized {}
16 changes: 16 additions & 0 deletions tests/EventsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace SeBuDesign\PoEditor\Test;

use SeBuDesign\PoEditor\Events\TranslationsSynchronized;

class EventsTest extends TestCase
{
/** @test */
public function it_has_all_terms_synchronised()
{
$this->expectsEvents(TranslationsSynchronized::class);

$this->artisan('synchronise:translations');
}
}

0 comments on commit 9ac1f3c

Please # to comment.