Skip to content

Commit

Permalink
Add support for laravel 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Skysplit committed Sep 1, 2016
1 parent 248c5fe commit 951a25b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ app('translator')->formatMessage($locale, $message, $params)
```

# Requirements
- Laravel 5.2
- Laravel **5.2** or **5.3**
- php-intl extension installed

Please feel free to contribute to this package for other Laravel versions support!
Expand All @@ -48,10 +48,20 @@ If you have other OS, you can use it's respective package manager

---

### Laravel 5.3

```bash
composer require skysplit/laravel5-intl-translation=^2.0
```

### Laravel 5.2
```bash
composer require skysplit/laravel5-intl-translation=~1.0
composer require skysplit/laravel5-intl-translation=^1.0
```


## All versions

In your `config/app.php` providers
Remove line
```php
Expand Down Expand Up @@ -89,7 +99,7 @@ php artisan vendor:publish --provider="Skysplit\Laravel\Translation\TranslationS
```

---
### Currently adapted locales
### Currently adapted locales

| Locale | Published files |
| --- | --- |
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
},
"require": {
"ext-intl": "*",
"illuminate/support": "^5.2",
"illuminate/translation": "^5.2",
"illuminate/validation": "^5.2"
"illuminate/support": "^5.3",
"illuminate/translation": "^5.3",
"illuminate/validation": "^5.3"
},
"require-dev": {
"orchestra/testbench": "^3.2",
"orchestra/testbench": "^3.3",
"phpunit/phpunit": "^4.0|^5.0"
}
}
9 changes: 4 additions & 5 deletions tests/TranslationDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ public function setUp()
{
parent::setUp();

// Perform migration
$this->artisan('migrate:refresh', [
$this->loadMigrationsFrom([
'--database' => 'testing',
'--path' => '../tests/database/migrations',
'--realpath' => realpath(__DIR__ . '/database/migrations'),
]);
}

Expand All @@ -30,7 +29,7 @@ public function getEnvironmentSetUp($app)

/**
* Create test user
*
*
* @return User
*/
public function makeUser()
Expand All @@ -55,7 +54,7 @@ public function testDatabaseValidators()
$validator = Validator::make($data, $rules);

$this->assertTrue($validator->fails());

$errors = $validator->getMessageBag();

$this->assertEquals('The selected exists is invalid.', $errors->first('exists'));
Expand Down
18 changes: 12 additions & 6 deletions tests/TranslationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Illuminate\Http\UploadedFile;
use Carbon\Carbon;

class TranslationTest extends TestCase
{

Expand Down Expand Up @@ -36,9 +36,15 @@ public function testSelect()

public function testValidatorMessages()
{
$imgDir = $this->fixturesPath . '/images';

// Create
File::makeDirectory($this->fixturesPath . '/images');

if (File::exists($imgDir)) {
File::deleteDirectory($imgDir);
}

File::makeDirectory($imgDir);

$faker = Faker\Factory::create($this->app['config']['locale']);
$fixturesPath = $this->fixturesPath;

Expand Down Expand Up @@ -174,7 +180,7 @@ public function testValidatorMessages()

$validator = Validator::make($data, $rules);
$errors = $validator->getMessageBag();

$this->assertFalse($validator->passes());
$this->assertNotEmpty($errors);
$this->assertEquals('The accepted must be accepted.', $errors->first('accepted'));
Expand Down Expand Up @@ -236,9 +242,9 @@ public function testValidatorMessages()
$this->assertEquals('The size array plural must contain 5 items.', $errors->first('size_array_plural'));
$this->assertEquals('The string must be a string.', $errors->first('string'));
$this->assertEquals('The timezone must be a valid zone.', $errors->first('timezone'));

// Delete temporary images directory
File::deleteDirectory($this->fixturesPath . '/images', false);
File::deleteDirectory($imgDir);
}

}

0 comments on commit 951a25b

Please sign in to comment.