Skip to content

Commit

Permalink
Apply patch from styleci
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr-Moik committed Mar 17, 2024
1 parent 3ae411a commit 51a70b8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/EloquentOverrideTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Astrotomic\Translatable\Tests;

use PHPUnit\Framework\Attributes\Test;
use Astrotomic\Translatable\Tests\Eloquent\Vegetable;
use PHPUnit\Framework\Attributes\Test;

final class EloquentOverrideTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/LocalesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Astrotomic\Translatable\Tests;

use PHPUnit\Framework\Attributes\Test;
use Astrotomic\Translatable\Exception\LocalesNotDefinedException;
use Astrotomic\Translatable\Locales;
use PHPUnit\Framework\Attributes\Test;

final class LocalesTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ScopesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Astrotomic\Translatable\Tests;

use PHPUnit\Framework\Attributes\Test;
use Astrotomic\Translatable\Tests\Eloquent\Country;
use Astrotomic\Translatable\Tests\Eloquent\Vegetable;
use PHPUnit\Framework\Attributes\Test;

final class ScopesTest extends TestCase
{
Expand Down
26 changes: 13 additions & 13 deletions tests/TranslatableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Astrotomic\Translatable\Tests;

use PHPUnit\Framework\Attributes\Test;
use Astrotomic\Translatable\Locales;
use Astrotomic\Translatable\Tests\Eloquent\Country;
use Astrotomic\Translatable\Tests\Eloquent\CountryStrict;
Expand All @@ -14,6 +13,7 @@
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use PHPUnit\Framework\Attributes\Test;

final class TranslatableTest extends TestCase
{
Expand Down Expand Up @@ -211,8 +211,8 @@ public function it_creates_translations_using_mass_assignment_and_locales(): voi
{
$vegetable = Vegetable::create([
'quantity' => 5,
'en' => ['name' => 'Peas'],
'fr' => ['name' => 'Pois'],
'en' => ['name' => 'Peas'],
'fr' => ['name' => 'Pois'],
]);

static::assertEquals(5, $vegetable->quantity);
Expand All @@ -230,8 +230,8 @@ public function it_skips_mass_assignment_if_attributes_non_fillable(): void
$this->expectException(MassAssignmentException::class);
$country = CountryStrict::create([
'code' => 'be',
'en' => ['name' => 'Belgium'],
'fr' => ['name' => 'Belgique'],
'en' => ['name' => 'Belgium'],
'fr' => ['name' => 'Belgique'],
]);

static::assertEquals('be', $country->code);
Expand Down Expand Up @@ -322,8 +322,8 @@ public function it_fills_a_non_default_language_with_fallback_set(): void
$vegetable = new Vegetable();
$vegetable->fill([
'quantity' => 5,
'en' => ['name' => 'Peas'],
'de' => ['name' => 'Erbsen'],
'en' => ['name' => 'Peas'],
'de' => ['name' => 'Erbsen'],
]);

static::assertEquals('Peas', $vegetable->translate('en')->name);
Expand Down Expand Up @@ -451,7 +451,7 @@ public function locales_as_array_keys_are_properly_detected(): void
$this->app->config->set('translatable.locales', ['en' => ['US', 'GB']]);

$vegetable = Vegetable::create([
'en' => ['name' => 'Peas'],
'en' => ['name' => 'Peas'],
'en-US' => ['name' => 'US Peas'],
'en-GB' => ['name' => 'GB Peas'],
]);
Expand Down Expand Up @@ -484,9 +484,9 @@ public function fallback_for_country_based_locales(): void
$this->app->make('translatable.locales')->load();

$vegetable = factory(Vegetable::class)->create([
'fr' => ['name' => 'Frites'],
'fr' => ['name' => 'Frites'],
'en-GB' => ['name' => 'Chips'],
'en' => ['name' => 'French fries'],
'en' => ['name' => 'French fries'],
]);

static::assertEquals('French fries', $vegetable->getTranslation('en-US')->name);
Expand All @@ -502,7 +502,7 @@ public function fallback_for_country_based_locales_with_no_base_locale(): void
$this->app->make('translatable.locales')->load();

$vegetable = factory(Vegetable::class)->create([
'en' => ['name' => 'Chips'],
'en' => ['name' => 'Chips'],
'pt-PT' => ['name' => 'Batatas fritas'],
]);

Expand Down Expand Up @@ -682,8 +682,8 @@ public function fill_will_ignore_unkown_locales(): void

$vegetable = new Vegetable();
$vegetable->fill([
'en' => ['name' => 'Peas'],
'ua' => ['name' => 'Unkown'],
'en' => ['name' => 'Peas'],
'ua' => ['name' => 'Unkown'],
]);
$vegetable->save();

Expand Down
2 changes: 1 addition & 1 deletion tests/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Astrotomic\Translatable\Tests;

use PHPUnit\Framework\Attributes\Test;
use Astrotomic\Translatable\Locales;
use Astrotomic\Translatable\Validation\RuleFactory;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\RequiredIf;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\Test;

final class ValidationTest extends TestCase
{
Expand Down

0 comments on commit 51a70b8

Please sign in to comment.