Documentation

RegistrationUserTest extends PersistentTools
in package
Uses ConnectionTrait, LoginLogoutTrait

Tags
psalm-suppress

PropertyNotSetInConstructor

Table of Contents

$crud  : PdoCrud|null
Connection to DB
$lastLogin  : string
Login of the last logged in user
getConnection()  : PdoCrud
Method returns database connection If you will pas array of connection names, then the first existing one will be returned
setConnection()  : void
Method sets connection
testRegisterUser()  : void
Testing user registration
requireLoggedIn()  : void
Method authorizes user
requireLoggedOut()  : void
Method forces user to logout
constructConnection()  : PdoCrud
Contructing connection to database object
dsnExists()  : bool
Method returns true if the connection exists, false otherwise
getConnectionForArray()  : PdoCrud
Method returns database connection
getConnectionScalar()  : PdoCrud
Method returns database connection If you will pas array of connection names, then the first existing one will be returned
validateDsn()  : void
Method validates dsn fields

Properties

$lastLogin

Login of the last logged in user

private static string $lastLogin = ''

Methods

getConnection()

Method returns database connection If you will pas array of connection names, then the first existing one will be returned

public static getConnection([string|array<string|int, string>|mixed $connectionName = 'default-db-connection' ]) : PdoCrud
Parameters
$connectionName : string|array<string|int, string>|mixed = 'default-db-connection'

connection name or array of connection names

Return values
PdoCrud

connection

setConnection()

Method sets connection

public static setConnection(PdoCrud|null $connection) : void
Parameters
$connection : PdoCrud|null

new connection or it's mock

Return values
void

testRegisterUser()

Testing user registration

public testRegisterUser() : void
Return values
void

requireLoggedIn()

Method authorizes user

protected requireLoggedIn(string $login, string $password) : void
Parameters
$login : string

user login

$password : string

user password

Return values
void

requireLoggedOut()

Method forces user to logout

protected requireLoggedOut() : void
Return values
void

constructConnection()

Contructing connection to database object

private static constructConnection() : PdoCrud
Tags
codeCoverageIgnore
Return values
PdoCrud

connection object wich is no initialized

dsnExists()

Method returns true if the connection exists, false otherwise

private static dsnExists(string $connectionName) : bool
Parameters
$connectionName : string

connection name

Return values
bool

true if the connection exists, false otherwise

getConnectionForArray()

Method returns database connection

private static getConnectionForArray(array<string|int, string> $connectionName) : PdoCrud
Parameters
$connectionName : array<string|int, string>

connection names

Return values
PdoCrud

connection

getConnectionScalar()

Method returns database connection If you will pas array of connection names, then the first existing one will be returned

private static getConnectionScalar([string $connectionName = 'default-db-connection' ]) : PdoCrud
Parameters
$connectionName : string = 'default-db-connection'

Connection name or array of connection names

Return values
PdoCrud

connection

validateDsn()

Method validates dsn fields

private static validateDsn(string $connectionName) : void
Parameters
$connectionName : string

connection name

Return values
void

Search results

    Яндекс.Метрика