mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-09 09:56:56 +01:00
* [ADD] Unit testing. Work in progress
* [MOD] Code refactoring * [MOD] Make classes final for performance improvements and avoid some side behaviours
This commit is contained in:
@@ -154,10 +154,17 @@ class ClientServiceTest extends DatabaseTestCase
|
||||
* @throws ConstraintException
|
||||
* @throws \SP\Core\Exceptions\QueryException
|
||||
*/
|
||||
public function testGetAllForUser()
|
||||
public function testGetAllForUserAdmin()
|
||||
{
|
||||
$this->assertCount(3, self::$service->getAllForUser());
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ConstraintException
|
||||
* @throws \SP\Core\Exceptions\QueryException
|
||||
*/
|
||||
public function testGetAllForUser()
|
||||
{
|
||||
$userData = new UserLoginResponse();
|
||||
$userData->setId(4);
|
||||
|
||||
@@ -174,8 +181,6 @@ class ClientServiceTest extends DatabaseTestCase
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$countBefore = $this->conn->getRowCount('Client');
|
||||
|
||||
$data = new ClientData();
|
||||
$data->name = 'Cliente prueba';
|
||||
$data->description = 'Descripción prueba';
|
||||
@@ -191,7 +196,7 @@ class ClientServiceTest extends DatabaseTestCase
|
||||
|
||||
$countAfter = $this->conn->getRowCount('Client');
|
||||
|
||||
$this->assertEquals($countBefore + 1, $countAfter);
|
||||
$this->assertEquals(4, $countAfter);
|
||||
|
||||
$this->expectException(DuplicatedItemException::class);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user