SessionDatabaseHandlerTest extends TestCase Uses TestDatabase, RefreshDatabase, withDatabaseSessionHandler
Integration tests for the session service.
Table of Contents
$migrated | bool | |
---|---|---|
setUp() | void | |
testSessionTable() | Test session table connection & existance | mixed |
testSessionWrite() | mixed | |
testUsingSessionDouble() | Simulate session service with database handler. | mixed |
testUsingSessionService() | mixed | |
sessionTests() | mixed | |
setupTestDatabase() | Define the test_integration database connection the default one | mixed |
refreshDatabase() | Define hooks to migrate the database before and after each test. | mixed |
usingInMemoryDatabase() | Determine if an in-memory database is being used. | bool |
refreshInMemoryDatabase() | Refresh the in-memory database. | mixed |
refreshTestDatabase() | Refresh a conventional test database. | mixed |
beginDatabaseTransaction() | Handle database transactions on the specified connections. | mixed |
connectionsToTransact() | The database connections that should have transactions. | array |
useDatabaseSessionHandler() | Reset CI with database session handler | mixed |
Properties
$migrated
public
static bool
$migrated
= false
Methods
setUp()
public
setUp(
)
: void
testSessionTable()
Test session table connection & existance
public
testSessionTable(
)
: mixed
Return values
mixedtestSessionWrite()
public
testSessionWrite(
)
: mixed
Tags
Return values
mixedtestUsingSessionDouble()
Simulate session service with database handler.
public
testUsingSessionDouble(
)
: mixed
We can't use the real service as it is created before we can even setup the in-memory database with the basic table we need
Tags
Return values
mixedtestUsingSessionService()
public
testUsingSessionService(
)
: mixed
Tags
Return values
mixedsessionTests()
protected
sessionTests(
$session :
Session
)
: mixed
Parameters
- $session : Session
Return values
mixedsetupTestDatabase()
Define the test_integration database connection the default one
public
setupTestDatabase(
)
: mixed
Return values
mixedrefreshDatabase()
Define hooks to migrate the database before and after each test.
public
refreshDatabase(
)
: mixed
Return values
mixedusingInMemoryDatabase()
Determine if an in-memory database is being used.
public
usingInMemoryDatabase(
)
: bool
Return values
boolrefreshInMemoryDatabase()
Refresh the in-memory database.
protected
refreshInMemoryDatabase(
)
: mixed
Return values
mixedrefreshTestDatabase()
Refresh a conventional test database.
protected
refreshTestDatabase(
)
: mixed
Return values
mixedbeginDatabaseTransaction()
Handle database transactions on the specified connections.
protected
beginDatabaseTransaction(
)
: mixed
Return values
mixedconnectionsToTransact()
The database connections that should have transactions.
protected
connectionsToTransact(
)
: array
Return values
arrayuseDatabaseSessionHandler()
Reset CI with database session handler
public
useDatabaseSessionHandler(
)
: mixed