/** * @expectedException Tectonic\LaravelLocalisation\Database\TranslationNotFound */ public function testTranslationUpdateWithNullTranslation() { $repository = m::mock(TranslationRepository::class); $repository->shouldReceive('getByCriteria')->once()->andReturn(null); $service = new TranslationService($repository); $model = new Model(); $service->update($model, 'en_GB', 'field', 'value'); }
/** * Handle the command. * * @param $command */ public function handle($command) { $role = Role::create(['default' => $command->default]); $this->roleRepository->save($role); $this->translationService->sync($role, $command->translated); $this->permissionsService->sync($role, $command->permissions); $this->eventDispatcher->dispatch($role->releaseEvents()); }