mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-03 07:04:07 +01:00
* [MOD] Update PHPunit to latest version.
* [MOD] Load fixtures using plain SQL files. * [MOD] Raise PHP version requirements (7.2 will be deprecated within a month). Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
@@ -59,14 +59,11 @@ class UserProfileRepositoryTest extends DatabaseTestCase
|
||||
* @throws NotFoundException
|
||||
* @throws ContextException
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
$dic = setupContext();
|
||||
|
||||
self::$dataset = 'syspass.xml';
|
||||
|
||||
// Datos de conexión a la BBDD
|
||||
self::$databaseConnectionData = $dic->get(DatabaseConnectionData::class);
|
||||
self::$loadFixtures = true;
|
||||
|
||||
// Inicializar el repositorio
|
||||
self::$repository = $dic->get(UserProfileRepository::class);
|
||||
@@ -159,7 +156,7 @@ class UserProfileRepositoryTest extends DatabaseTestCase
|
||||
$result = self::$repository->delete(3);
|
||||
|
||||
$this->assertEquals(1, $result);
|
||||
$this->assertEquals(2, $this->conn->getRowCount('UserProfile'));
|
||||
$this->assertEquals(2, self::getRowCount('UserProfile'));
|
||||
|
||||
$this->expectException(ConstraintException::class);
|
||||
|
||||
@@ -201,7 +198,7 @@ class UserProfileRepositoryTest extends DatabaseTestCase
|
||||
$result = self::$repository->create($data);
|
||||
|
||||
$this->assertEquals($data->getId(), $result);
|
||||
$this->assertEquals(4, $this->conn->getRowCount('UserProfile'));
|
||||
$this->assertEquals(4, self::getRowCount('UserProfile'));
|
||||
|
||||
/** @var UserProfileData $resultData */
|
||||
$resultData = self::$repository->getById($result)->getData();
|
||||
|
||||
Reference in New Issue
Block a user