Skip to content
This repository was archived by the owner on Jan 27, 2020. It is now read-only.

Commit 916ac3f

Browse files
committed
Initial Commit
0 parents  commit 916ac3f

File tree

8 files changed

+201
-0
lines changed

8 files changed

+201
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor
2+
composer.lock
3+
.idea/

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2015 Mohamed Said <theMohamedSaid@gmail.com>
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

Whitespace-only changes.

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "themsaid/Multilingual",
3+
"description": "Easy multilingual laravel models",
4+
"keywords": ["laravel", "multilingual", "translation"],
5+
"homepage": "https://github.com/themsaid/laravel-multilingual",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Mohamed Said",
10+
"email": "theMohamedSaid@gmail.com"
11+
}
12+
],
13+
"require": {
14+
"illuminate/support": "~5.1",
15+
"php" : ">=5.3.0"
16+
},
17+
"require-dev": {
18+
"phpunit/phpunit" : "4.*",
19+
"orchestra/testbench": "~3.0"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"Themsaid\\Multilingual\\": "src"
24+
},
25+
"classmap": [
26+
"tests"
27+
]
28+
}
29+
}

phpunit.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false">
12+
<testsuites>
13+
<testsuite name="Package Test Suite">
14+
<directory suffix=".php">./tests/</directory>
15+
</testsuite>
16+
</testsuites>
17+
</phpunit>

src/MultilingualServiceProvider.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace Themsaid\Multilingual;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
7+
class MultilingualServiceProvider extends ServiceProvider
8+
{
9+
/**
10+
* Perform post-registration booting of services.
11+
*
12+
* @return void
13+
*/
14+
public function boot()
15+
{
16+
17+
}
18+
19+
/**
20+
* Register any package services.
21+
*
22+
* @return void
23+
*/
24+
public function register()
25+
{
26+
//
27+
}
28+
}

tests/TestCase.php

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Support\Facades\DB;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class TestCase extends Orchestra\Testbench\TestCase {
8+
9+
protected $DBName = 'laravel_multilingual_test';
10+
protected $DBUsername = 'homestead';
11+
protected $DBPassword = 'secret';
12+
13+
/**
14+
* Setup the test environment.
15+
*
16+
* @return void
17+
*/
18+
public function setUp()
19+
{
20+
parent::setUp();
21+
22+
$this->prepareDatabase();
23+
}
24+
25+
public function test_database_setup()
26+
{
27+
$this->assertTrue(Schema::hasTable('planets'));
28+
}
29+
30+
/**
31+
* Define environment setup.
32+
*
33+
* @param \Illuminate\Foundation\Application $app
34+
* @return void
35+
*/
36+
protected function getEnvironmentSetUp($app)
37+
{
38+
$app['config']->set('database.default', 'mysql');
39+
$app['config']->set('database.connections.mysql', [
40+
'driver' => 'mysql',
41+
'host' => 'localhost',
42+
'database' => $this->DBName,
43+
'username' => $this->DBUsername,
44+
'password' => $this->DBPassword,
45+
'charset' => 'utf8',
46+
'collation' => 'utf8_unicode_ci',
47+
'prefix' => '',
48+
'strict' => false,
49+
]);
50+
}
51+
52+
/**
53+
* Loading package service provider
54+
*
55+
* @param \Illuminate\Foundation\Application $app
56+
* @return array
57+
*/
58+
protected function getPackageProviders($app)
59+
{
60+
return ['Themsaid\Multilingual\MultilingualServiceProvider'];
61+
}
62+
63+
/**
64+
* Get package aliases.
65+
*
66+
* @param \Illuminate\Foundation\Application $app
67+
*
68+
* @return array
69+
*/
70+
protected function getPackageAliases($app)
71+
{
72+
return [
73+
'Schema' => 'Illuminate\Database\Schema\Blueprint'
74+
];
75+
}
76+
77+
public function prepareDatabase()
78+
{
79+
Schema::dropIfExists('planets');
80+
81+
Schema::create('planets', function (Blueprint $table)
82+
{
83+
$table->increments('id');
84+
$table->string('name');
85+
});
86+
87+
}
88+
}

tests/TranslationsTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use Illuminate\Foundation\Testing\DatabaseTransactions;
4+
5+
class ExampleTest extends TestCase {
6+
7+
/**
8+
*
9+
* @return void
10+
*/
11+
public function testBasicExample()
12+
{
13+
$this->assertEquals(1, 1);
14+
}
15+
}

0 commit comments

Comments
 (0)