Add more front-end controllers, language file cleanup
This commit is contained in:
parent
4532811fcd
commit
54554465f2
59 changed files with 1100 additions and 336 deletions
|
@ -247,7 +247,7 @@ class AssignmentServiceTest extends TestCase
|
|||
$this->service->handle($this->node->id, $data);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.allocations.cidr_out_of_range'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.allocations.cidr_out_of_range'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ class AssignmentServiceTest extends TestCase
|
|||
}
|
||||
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.allocations.too_many_ports'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.allocations.too_many_ports'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ class AssignmentServiceTest extends TestCase
|
|||
}
|
||||
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.allocations.invalid_mapping', ['port' => 'test123']), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.allocations.invalid_mapping', ['port' => 'test123']), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ class DatabaseHostServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->delete(1);
|
||||
} catch (DisplayException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.databases.delete_has_databases'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.databases.delete_has_databases'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class NodeDeletionServiceTest extends TestCase
|
|||
{
|
||||
$this->serverRepository->shouldReceive('withColumns')->with('id')->once()->andReturnSelf()
|
||||
->shouldReceive('findCountWhere')->with([['node_id', '=', 1]])->once()->andReturn(1);
|
||||
$this->translator->shouldReceive('trans')->with('admin/exceptions.node.servers_attached')->once()->andReturnNull();
|
||||
$this->translator->shouldReceive('trans')->with('exceptions.node.servers_attached')->once()->andReturnNull();
|
||||
$this->repository->shouldNotReceive('delete');
|
||||
|
||||
$this->service->handle(1);
|
||||
|
|
|
@ -157,7 +157,7 @@ class NodeUpdateServiceTest extends TestCase
|
|||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(
|
||||
trans('admin/exceptions.node.daemon_off_config_updated', ['code' => 400]),
|
||||
trans('exceptions.node.daemon_off_config_updated', ['code' => 400]),
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ class PackCreationServiceTest extends TestCase
|
|||
$this->service->handle([], $this->file);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(InvalidFileUploadException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.packs.invalid_upload'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.packs.invalid_upload'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ class PackCreationServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle([], $this->file);
|
||||
} catch (InvalidFileMimeTypeException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.invalid_mime', [
|
||||
$this->assertEquals(trans('exceptions.packs.invalid_mime', [
|
||||
'type' => implode(', ', PackCreationService::VALID_UPLOAD_TYPES),
|
||||
]), $exception->getMessage());
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ class PackDeletionServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle($model);
|
||||
} catch (HasActiveServersException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.delete_has_servers'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.packs.delete_has_servers'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class PackUpdateServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle($model, ['option_id' => 0]);
|
||||
} catch (HasActiveServersException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.update_has_servers'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.packs.update_has_servers'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ class TemplateUploadServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle(1, $this->file);
|
||||
} catch (InvalidFileUploadException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.invalid_upload'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.packs.invalid_upload'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ class TemplateUploadServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle(1, $this->file);
|
||||
} catch (InvalidFileMimeTypeException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.invalid_mime', [
|
||||
$this->assertEquals(trans('exceptions.packs.invalid_mime', [
|
||||
'type' => implode(', ', TemplateUploadService::VALID_UPLOAD_TYPES),
|
||||
]), $exception->getMessage());
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ class TemplateUploadServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle(1, $this->file);
|
||||
} catch (UnreadableZipArchiveException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.unreadable'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.packs.unreadable'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ class TemplateUploadServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle(1, $this->file);
|
||||
} catch (InvalidPackArchiveFormatException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.invalid_archive_exception'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.packs.invalid_archive_exception'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ class TemplateUploadServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle(1, $this->file);
|
||||
} catch (ZipExtractionException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.packs.zip_extraction'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.packs.zip_extraction'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class InstallScriptUpdateServiceTest extends TestCase
|
|||
$this->service->handle($this->model, $this->data);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(InvalidCopyFromException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.service.options.invalid_copy_id'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.service.options.invalid_copy_id'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ class OptionCreationServiceTest extends TestCase
|
|||
$this->service->handle(['config_from' => 1]);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(NoParentConfigurationFoundException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.service.options.must_be_child'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.service.options.must_be_child'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class OptionDeletionServiceTest extends TestCase
|
|||
$this->service->handle(1);
|
||||
} catch (\Exception $exception) {
|
||||
$this->assertInstanceOf(HasActiveServersException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.service.options.delete_has_servers'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.service.options.delete_has_servers'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ class OptionUpdateServiceTest extends TestCase
|
|||
$this->service->handle($this->model, ['config_from' => 1]);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(NoParentConfigurationFoundException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.service.options.must_be_child'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.service.options.must_be_child'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ class ServiceDeletionServiceTest extends TestCase
|
|||
$this->service->handle(1);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(HasActiveServersException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.service.delete_has_servers'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.service.delete_has_servers'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ class VariableUpdateServiceTest extends TestCase
|
|||
$this->service->handle($this->model, ['env_variable' => 'TEST_VAR_123']);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.service.variables.env_not_unique', [
|
||||
$this->assertEquals(trans('exceptions.service.variables.env_not_unique', [
|
||||
'name' => 'TEST_VAR_123',
|
||||
]), $exception->getMessage());
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ class SubuserCreationServiceTest extends TestCase
|
|||
$this->service->handle($server, $user->email, []);
|
||||
} catch (DisplayException $exception) {
|
||||
$this->assertInstanceOf(UserIsServerOwnerException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.subusers.user_is_owner'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.subusers.user_is_owner'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ class SubuserCreationServiceTest extends TestCase
|
|||
$this->service->handle($server, $user->email, []);
|
||||
} catch (DisplayException $exception) {
|
||||
$this->assertInstanceOf(ServerSubuserExistsException::class, $exception);
|
||||
$this->assertEquals(trans('admin/exceptions.subusers.subuser_exists'), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.subusers.subuser_exists'), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ class SubuserDeletionServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle($subuser->id);
|
||||
} catch (DisplayException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.daemon_connection_failed', ['code' => 'E_CONN_REFUSED']), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.daemon_connection_failed', ['code' => 'E_CONN_REFUSED']), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ class SubuserUpdateServiceTest extends TestCase
|
|||
try {
|
||||
$this->service->handle($subuser->id, []);
|
||||
} catch (DisplayException $exception) {
|
||||
$this->assertEquals(trans('admin/exceptions.daemon_connection_failed', ['code' => 'E_CONN_REFUSED']), $exception->getMessage());
|
||||
$this->assertEquals(trans('exceptions.daemon_connection_failed', ['code' => 'E_CONN_REFUSED']), $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue