FixtureInterface
in
Defines the interface that testing fixtures use.
Table of Contents
Methods
- connection() : string
- Get the connection name this fixture should be inserted into.
- create() : bool
- Create the fixture schema/mapping/definition
- drop() : bool
- Run after all tests executed, should remove the table/collection from the connection.
- insert() : StatementInterface|bool
- Run before each test is executed.
- sourceName() : string
- Get the table/collection name for this fixture.
- truncate() : bool
- Truncates the current fixture.
Methods
connection()
Get the connection name this fixture should be inserted into.
public
connection() : string
Return values
stringcreate()
Create the fixture schema/mapping/definition
public
create(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
-
An instance of the connection the fixture should be created on.
Return values
bool —True on success, false on failure.
drop()
Run after all tests executed, should remove the table/collection from the connection.
public
drop(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
-
An instance of the connection the fixture should be removed from.
Return values
bool —True on success, false on failure.
insert()
Run before each test is executed.
public
insert(ConnectionInterface $connection) : StatementInterface|bool
Should insert all the records into the test database.
Parameters
- $connection : ConnectionInterface
-
An instance of the connection into which the records will be inserted.
Return values
StatementInterface|bool —on success or if there are no records to insert, or false on failure.
sourceName()
Get the table/collection name for this fixture.
public
sourceName() : string
Return values
stringtruncate()
Truncates the current fixture.
public
truncate(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
-
A reference to a db instance