3 namespace Friendica\Test\Util;
5 use Friendica\Core\L10n;
6 use Mockery\MockInterface;
11 * @var MockInterface The interface for L10n mocks
16 * Mocking the 'L10n::t()' method
18 * @param null|string $input Either an input (string) or null for EVERY input is possible
19 * @param null|int $times How often will it get called
20 * @param null|string $return Either an return (string) or null for return the input
22 public function mockL10nT($input = null, $times = null, $return = null)
24 if (!isset($this->l10nMock)) {
25 $this->l10nMock = \Mockery::mock('alias:' . L10n::class);
28 $with = isset($input) ? $input : \Mockery::any();
30 $return = isset($return) ? $return : $with;
32 if ($return instanceof \Mockery\Matcher\Any) {
37 ->andReturnUsing(function($arg) { return $arg; });