Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
c5dc42a7
Commit
c5dc42a7
authored
Jul 20, 2017
by
Pascal Luna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed translator.resources definition
parent
74d9869d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
src/Silex/Provider/TranslationServiceProvider.php
src/Silex/Provider/TranslationServiceProvider.php
+2
-2
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
+12
-1
No files found.
src/Silex/Provider/TranslationServiceProvider.php
View file @
c5dc42a7
...
...
@@ -80,9 +80,9 @@ class TranslationServiceProvider implements ServiceProviderInterface, EventListe
return
new
MessageSelector
();
};
$app
[
'translator.resources'
]
=
$app
->
protect
(
function
(
$app
)
{
$app
[
'translator.resources'
]
=
function
(
$app
)
{
return
array
();
}
)
;
};
$app
[
'translator.domains'
]
=
array
();
$app
[
'locale_fallbacks'
]
=
array
(
'en'
);
...
...
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
View file @
c5dc42a7
...
...
@@ -82,7 +82,7 @@ class ValidatorServiceProviderTest extends TestCase
*/
public
function
testValidatorServiceIsAValidator
(
$app
)
{
$this
->
assertTrue
(
$app
[
'validator'
]
instanceof
ValidatorInterface
||
$app
[
'validator'
]
instanceof
LegacyValidatorInterface
);
$this
->
assertTrue
(
$app
[
'validator'
]
instanceof
ValidatorInterface
||
$app
[
'validator'
]
instanceof
LegacyValidatorInterface
);
}
/**
...
...
@@ -192,4 +192,15 @@ class ValidatorServiceProviderTest extends TestCase
$this
->
assertEquals
(
'Pas vide'
,
$app
[
'translator'
]
->
trans
(
'This value should not be blank.'
,
array
(),
'validators'
,
'fr'
));
}
public
function
testTranslatorResourcesIsArray
()
{
$app
=
new
Application
();
$app
[
'locale'
]
=
'fr'
;
$app
->
register
(
new
ValidatorServiceProvider
());
$app
->
register
(
new
TranslationServiceProvider
());
$this
->
assertInternalType
(
'array'
,
$app
[
'translator.resources'
]);
}
}
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