Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
d50c9e15
Unverified
Commit
d50c9e15
authored
Jul 12, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setting up translation module to be tested
parent
3997dc5f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
0 deletions
+89
-0
.gitkeep
Modules/Translation/Tests/.gitkeep
+0
-0
BaseTranslationTest.php
Modules/Translation/Tests/BaseTranslationTest.php
+64
-0
EloquentTranslationRepositoryTest.php
...s/Translation/Tests/EloquentTranslationRepositoryTest.php
+25
-0
No files found.
Modules/Translation/Tests/.gitkeep
deleted
100644 → 0
View file @
3997dc5f
Modules/Translation/Tests/BaseTranslationTest.php
0 → 100644
View file @
d50c9e15
<?php
namespace
Modules\Translation\Tests
;
use
Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider
;
use
Modules\Core\Providers\CoreServiceProvider
;
use
Modules\Core\Providers\SidebarServiceProvider
;
use
Modules\Translation\Providers\TranslationServiceProvider
;
use
Nwidart\Modules\LaravelModulesServiceProvider
;
use
Orchestra\Testbench\TestCase
;
class
BaseTranslationTest
extends
TestCase
{
public
function
setUp
()
{
parent
::
setUp
();
$this
->
resetDatabase
();
}
protected
function
getPackageProviders
(
$app
)
{
return
[
LaravelModulesServiceProvider
::
class
,
CoreServiceProvider
::
class
,
TranslationServiceProvider
::
class
,
LaravelLocalizationServiceProvider
::
class
,
SidebarServiceProvider
::
class
,
];
}
protected
function
getPackageAliases
(
$app
)
{
return
[];
}
protected
function
getEnvironmentSetUp
(
$app
)
{
$app
[
'path.base'
]
=
__DIR__
.
'/..'
;
$app
[
'config'
]
->
set
(
'database.default'
,
'sqlite'
);
$app
[
'config'
]
->
set
(
'database.connections.sqlite'
,
array
(
'driver'
=>
'sqlite'
,
'database'
=>
':memory:'
,
'prefix'
=>
''
,
));
$app
[
'config'
]
->
set
(
'translatable.locales'
,
[
'en'
,
'fr'
]);
}
private
function
resetDatabase
()
{
// Makes sure the migrations table is created
$this
->
artisan
(
'migrate'
,
[
'--database'
=>
'sqlite'
,
]);
// We empty all tables
$this
->
artisan
(
'migrate:reset'
,
[
'--database'
=>
'sqlite'
,
]);
// Migrate
$this
->
artisan
(
'migrate'
,
[
'--database'
=>
'sqlite'
,
]);
}
}
Modules/Translation/Tests/EloquentTranslationRepositoryTest.php
0 → 100644
View file @
d50c9e15
<?php
namespace
Modules\Translation\Tests
;
use
Modules\Translation\Repositories\TranslationRepository
;
class
EloquentTranslationRepositoryTest
extends
BaseTranslationTest
{
/**
* @var TranslationRepository
*/
private
$translation
;
public
function
setUp
()
{
parent
::
setUp
();
$this
->
translation
=
app
(
TranslationRepository
::
class
);
}
/** @test */
public
function
it_is_true
()
{
$this
->
assertTrue
(
true
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment