* [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:
nuxsmin
2018-07-28 19:15:11 +02:00
parent d0056d74a8
commit 3e26a1df71
367 changed files with 1774 additions and 1251 deletions

View File

@@ -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);