Massive PHPCS linting
This commit is contained in:
parent
78c8b8d8ea
commit
3ee5803416
346 changed files with 834 additions and 1424 deletions
|
@ -72,7 +72,10 @@ class KeyServiceTest extends TestCase
|
|||
$this->repository = m::mock(ApiKeyRepositoryInterface::class);
|
||||
|
||||
$this->service = new KeyService(
|
||||
$this->repository, $this->database, $this->encrypter, $this->permissions
|
||||
$this->repository,
|
||||
$this->database,
|
||||
$this->encrypter,
|
||||
$this->permissions
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -108,7 +111,9 @@ class KeyServiceTest extends TestCase
|
|||
$this->database->shouldReceive('commit')->withNoArgs()->once()->andReturnNull();
|
||||
|
||||
$response = $this->service->create(
|
||||
['test-data' => 'test'], ['invalid-node', 'server-list'], ['invalid-node', 'server-create']
|
||||
['test-data' => 'test'],
|
||||
['invalid-node', 'server-list'],
|
||||
['invalid-node', 'server-create']
|
||||
);
|
||||
|
||||
$this->assertNotEmpty($response);
|
||||
|
|
|
@ -112,16 +112,23 @@ class DatabaseManagementServiceTest extends TestCase
|
|||
->once()
|
||||
->andReturnNull();
|
||||
$this->repository->shouldReceive('createDatabase')->with(
|
||||
self::TEST_DATA['database'], 'dynamic'
|
||||
self::TEST_DATA['database'],
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
|
||||
$this->encrypter->shouldReceive('decrypt')->with('enc_password')->once()->andReturn('str_random');
|
||||
$this->repository->shouldReceive('createUser')->with(
|
||||
self::TEST_DATA['username'], self::TEST_DATA['remote'], 'str_random', 'dynamic'
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'str_random',
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
|
||||
$this->repository->shouldReceive('assignUserToDatabase')->with(
|
||||
self::TEST_DATA['database'], self::TEST_DATA['username'], self::TEST_DATA['remote'], 'dynamic'
|
||||
self::TEST_DATA['database'],
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
|
||||
$this->repository->shouldReceive('flush')->with('dynamic')->once()->andReturnNull();
|
||||
|
@ -184,7 +191,8 @@ class DatabaseManagementServiceTest extends TestCase
|
|||
->once()
|
||||
->andReturnNull();
|
||||
$this->repository->shouldReceive('createDatabase')->with(
|
||||
self::TEST_DATA['database'], 'dynamic'
|
||||
self::TEST_DATA['database'],
|
||||
'dynamic'
|
||||
)->once()->andThrow(new Exception('Test Message'));
|
||||
|
||||
$this->repository->shouldReceive('dropDatabase')
|
||||
|
@ -192,7 +200,9 @@ class DatabaseManagementServiceTest extends TestCase
|
|||
->once()
|
||||
->andReturnNull();
|
||||
$this->repository->shouldReceive('dropUser')->with(
|
||||
self::TEST_DATA['username'], self::TEST_DATA['remote'], 'dynamic'
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
$this->repository->shouldReceive('flush')->with('dynamic')->once()->andReturnNull();
|
||||
|
||||
|
@ -221,7 +231,8 @@ class DatabaseManagementServiceTest extends TestCase
|
|||
->once()
|
||||
->andReturnNull();
|
||||
$this->repository->shouldReceive('createDatabase')->with(
|
||||
self::TEST_DATA['database'], 'dynamic'
|
||||
self::TEST_DATA['database'],
|
||||
'dynamic'
|
||||
)->once()->andThrow(new Exception('Test One'));
|
||||
|
||||
$this->repository->shouldReceive('dropDatabase')->with(self::TEST_DATA['database'], 'dynamic')
|
||||
|
@ -260,15 +271,23 @@ class DatabaseManagementServiceTest extends TestCase
|
|||
])->andReturn(true);
|
||||
|
||||
$this->repository->shouldReceive('dropUser')->with(
|
||||
self::TEST_DATA['username'], self::TEST_DATA['remote'], 'dynamic'
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
|
||||
$this->repository->shouldReceive('createUser')->with(
|
||||
self::TEST_DATA['username'], self::TEST_DATA['remote'], 'new_password', 'dynamic'
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'new_password',
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
|
||||
$this->repository->shouldReceive('assignUserToDatabase')->with(
|
||||
self::TEST_DATA['database'], self::TEST_DATA['username'], self::TEST_DATA['remote'], 'dynamic'
|
||||
self::TEST_DATA['database'],
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
|
||||
$this->repository->shouldReceive('flush')->with('dynamic')->once()->andReturnNull();
|
||||
|
@ -300,7 +319,9 @@ class DatabaseManagementServiceTest extends TestCase
|
|||
])->andReturn(true);
|
||||
|
||||
$this->repository->shouldReceive('dropUser')->with(
|
||||
self::TEST_DATA['username'], self::TEST_DATA['remote'], 'dynamic'
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'dynamic'
|
||||
)->once()->andThrow(new Exception());
|
||||
|
||||
$this->database->shouldReceive('rollBack')->withNoArgs()->once()->andReturnNull();
|
||||
|
@ -324,7 +345,9 @@ class DatabaseManagementServiceTest extends TestCase
|
|||
->once()
|
||||
->andReturnNull();
|
||||
$this->repository->shouldReceive('dropUser')->with(
|
||||
self::TEST_DATA['username'], self::TEST_DATA['remote'], 'dynamic'
|
||||
self::TEST_DATA['username'],
|
||||
self::TEST_DATA['remote'],
|
||||
'dynamic'
|
||||
)->once()->andReturnNull();
|
||||
$this->repository->shouldReceive('flush')->with('dynamic')->once()->andReturnNull();
|
||||
$this->repository->shouldReceive('delete')->with(1)->once()->andReturn(1);
|
||||
|
|
|
@ -157,7 +157,8 @@ class UpdateServiceTest extends TestCase
|
|||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(
|
||||
trans('admin/exceptions.node.daemon_off_config_updated', ['code' => 400]), $exception->getMessage()
|
||||
trans('admin/exceptions.node.daemon_off_config_updated', ['code' => 400]),
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class PackUpdateServiceTest extends TestCase
|
|||
'locked' => false,
|
||||
'visible' => false,
|
||||
'selectable' => false,
|
||||
'test-data' => 'value'
|
||||
'test-data' => 'value',
|
||||
])->once()->andReturn(1);
|
||||
|
||||
$this->assertEquals(1, $this->service->handle($model, ['test-data' => 'value']));
|
||||
|
@ -108,7 +108,7 @@ class PackUpdateServiceTest extends TestCase
|
|||
'locked' => false,
|
||||
'visible' => false,
|
||||
'selectable' => false,
|
||||
'test-data' => 'value'
|
||||
'test-data' => 'value',
|
||||
])->once()->andReturn(1);
|
||||
|
||||
$this->assertEquals(1, $this->service->handle($model->id, ['test-data' => 'value']));
|
||||
|
|
|
@ -246,7 +246,7 @@ class TemplateUploadServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Return values for archive->locateName function, import.json and archive.tar.gz respectively
|
||||
* Return values for archive->locateName function, import.json and archive.tar.gz respectively.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -133,7 +133,8 @@ class ContainerRebuildServiceTest extends TestCase
|
|||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage()
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]),
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -258,7 +258,8 @@ class DetailsModificationServiceTest extends TestCase
|
|||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage()
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]),
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -371,7 +372,8 @@ class DetailsModificationServiceTest extends TestCase
|
|||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage()
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]),
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,7 +162,8 @@ class ReinstallServiceTest extends TestCase
|
|||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage()
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]),
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -190,7 +190,8 @@ class SuspensionServiceTest extends TestCase
|
|||
} catch (Exception $exception) {
|
||||
$this->assertInstanceOf(DisplayException::class, $exception);
|
||||
$this->assertEquals(
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]), $exception->getMessage()
|
||||
trans('admin/server.exceptions.daemon_exception', ['code' => 400]),
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,9 @@ class DeletionServiceTest extends TestCase
|
|||
$this->serverRepository = m::mock(ServerRepositoryInterface::class);
|
||||
|
||||
$this->service = new DeletionService(
|
||||
$this->serverRepository, $this->translator, $this->repository
|
||||
$this->serverRepository,
|
||||
$this->translator,
|
||||
$this->repository
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue