This repository has been archived by the owner on Jan 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 916ac3f
Showing
8 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor | ||
composer.lock | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Mohamed Said <theMohamedSaid@gmail.com> | ||
|
||
> Permission is hereby granted, free of charge, to any person obtaining a copy | ||
> of this software and associated documentation files (the "Software"), to deal | ||
> in the Software without restriction, including without limitation the rights | ||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
> copies of the Software, and to permit persons to whom the Software is | ||
> furnished to do so, subject to the following conditions: | ||
> | ||
> The above copyright notice and this permission notice shall be included in | ||
> all copies or substantial portions of the Software. | ||
> | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
> THE SOFTWARE. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "themsaid/Multilingual", | ||
"description": "Easy multilingual laravel models", | ||
"keywords": ["laravel", "multilingual", "translation"], | ||
"homepage": "https://github.com/themsaid/laravel-multilingual", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Mohamed Said", | ||
"email": "theMohamedSaid@gmail.com" | ||
} | ||
], | ||
"require": { | ||
"illuminate/support": "~5.1", | ||
"php" : ">=5.3.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit" : "4.*", | ||
"orchestra/testbench": "~3.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Themsaid\\Multilingual\\": "src" | ||
}, | ||
"classmap": [ | ||
"tests" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false"> | ||
<testsuites> | ||
<testsuite name="Package Test Suite"> | ||
<directory suffix=".php">./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Themsaid\Multilingual; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class MultilingualServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Perform post-registration booting of services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Register any package services. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class TestCase extends Orchestra\Testbench\TestCase { | ||
|
||
protected $DBName = 'laravel_multilingual_test'; | ||
protected $DBUsername = 'homestead'; | ||
protected $DBPassword = 'secret'; | ||
|
||
/** | ||
* Setup the test environment. | ||
* | ||
* @return void | ||
*/ | ||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$this->prepareDatabase(); | ||
} | ||
|
||
public function test_database_setup() | ||
{ | ||
$this->assertTrue(Schema::hasTable('planets')); | ||
} | ||
|
||
/** | ||
* Define environment setup. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* @return void | ||
*/ | ||
protected function getEnvironmentSetUp($app) | ||
{ | ||
$app['config']->set('database.default', 'mysql'); | ||
$app['config']->set('database.connections.mysql', [ | ||
'driver' => 'mysql', | ||
'host' => 'localhost', | ||
'database' => $this->DBName, | ||
'username' => $this->DBUsername, | ||
'password' => $this->DBPassword, | ||
'charset' => 'utf8', | ||
'collation' => 'utf8_unicode_ci', | ||
'prefix' => '', | ||
'strict' => false, | ||
]); | ||
} | ||
|
||
/** | ||
* Loading package service provider | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* @return array | ||
*/ | ||
protected function getPackageProviders($app) | ||
{ | ||
return ['Themsaid\Multilingual\MultilingualServiceProvider']; | ||
} | ||
|
||
/** | ||
* Get package aliases. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return array | ||
*/ | ||
protected function getPackageAliases($app) | ||
{ | ||
return [ | ||
'Schema' => 'Illuminate\Database\Schema\Blueprint' | ||
]; | ||
} | ||
|
||
public function prepareDatabase() | ||
{ | ||
Schema::dropIfExists('planets'); | ||
|
||
Schema::create('planets', function (Blueprint $table) | ||
{ | ||
$table->increments('id'); | ||
$table->string('name'); | ||
}); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
use Illuminate\Foundation\Testing\DatabaseTransactions; | ||
|
||
class ExampleTest extends TestCase { | ||
|
||
/** | ||
* | ||
* @return void | ||
*/ | ||
public function testBasicExample() | ||
{ | ||
$this->assertEquals(1, 1); | ||
} | ||
} |