mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
17 lines
493 B
PHP
17 lines
493 B
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Tools;
|
|
|
|
trait TranslatorMockTrait
|
|
{
|
|
public function createTranslatorMock()
|
|
{
|
|
$translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface', ['addResource', 'trans', 'transChoice', 'setLocale', 'getLocale', 'setFallbackLocales', 'addLoader']);
|
|
$translator->expects($this->any())
|
|
->method('trans')
|
|
->will($this->returnCallback(function ($id) { return $id;}));
|
|
|
|
return $translator;
|
|
}
|
|
}
|