Flugg\Responder\Tests\TestCase::mockTranslator PHP Метод

mockTranslator() защищенный Метод

Create a mock of Laravel's translator and binds it to the service container.
protected mockTranslator ( string $message ) : Mockery\MockInterface
$message string
Результат Mockery\MockInterface
    protected function mockTranslator(string $message)
    {
        $translator = Mockery::spy(Translator::class);
        $translator->shouldReceive('has')->andReturn(true);
        $translator->shouldReceive('trans')->andReturn($message);
        $this->app->loadDeferredProvider('translator');
        $this->app->instance('translator', $translator);
        return $translator;
    }