3 namespace Friendica\Test\Util;
5 use Mockery\MockInterface;
10 * @var MockInterface The interface for L10n mocks
15 * Mocking the 'L10n::t()' method
17 * @param null|string $input Either an input (string) or null for EVERY input is possible
18 * @param null|int $times How often will it get called
19 * @param null|string $return Either an return (string) or null for return the input
21 public function mockL10nT($input = null, $times = null, $return = null)
23 if (!isset($this->l10nMock)) {
24 $this->l10nMock = \Mockery::mock('alias:Friendica\Core\L10n');
27 $with = isset($input) ? $input : \Mockery::any();
29 $return = isset($return) ? $return : $with;
31 if ($return instanceof \Mockery\Matcher\Any) {
36 ->andReturnUsing(function($arg) { return $arg; });